06-16-2011, 04:15 PM | #1 |
Guru
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
|
Calibre E-Book Viewer and ADE render ePub TD font-size differently
I have noticed that the font-size that calibre's book viewer uses to render TD elements is different to that used by ADE. After a bit of testing it appears that ADE mutlipies the BODY font-size and the TD font-size together to generate the actual font-size for rendering, whereas calibre viewer simply uses the font-size defined in the style for TD.
Example: body { font-size:1.5em } td { font-size:1.5em } Calibre viewer renders TD elements at 1.5em, ADE renders at 2.25em. So, is one of these right and the other wrong, or do different readers vary in their approach. I have only been able to test calibre reader and Sony, (ADE), and I would like to make ePubs which display consistently on different readers. |
06-16-2011, 06:07 PM | #2 | |
Well trained by Cats
Posts: 29,754
Karma: 54401244
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
The question is: does the scale apply to the base font size or the inherited font size? |
|
Advert | |
|
06-16-2011, 07:58 PM | #3 |
creator of calibre
Posts: 43,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
calibre's viewer uses WebKit, the html rendering library used by Chrome and Safari (and other browsers) to render HTML.
|
06-17-2011, 02:02 AM | #4 |
Guru
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
|
I tried in IE8 and IE9 and they render the same as Calibre, Chrome and Safari, so it seems that ADE is perhaps the odd one out. However, the scaling applies to the inherited font size and I would have thought that ADE was actually right since this is the way that CSS usually works, and nesting other tags, (body,blockquote,div,p,span), does lead to such scaling! I don't know why tables should be exempt from CSS inheritence, (all properties or just some?), but there seems to be agreement between many rendering systems that this is correct.
So, can I do anything to get ADE to render in the same way or should I avoid using tables and find some other way to line up columns of data? For example, do readers support the CSS width property with <span> elements? Update: I wonder if tables are treated differently due to the possibility of nesting them, which would result in progressive scaling of the font-size with each nesting level? Update2: It seems that there is more to this than meets the eye! I found some useful information about this, (and other 'quirks'), at http://www.quirksmode.org/css/quirksmode.html Last edited by Agama; 06-17-2011 at 02:38 AM. Reason: Update2 |
06-17-2011, 02:36 AM | #5 |
creator of calibre
Posts: 43,826
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
set a font size on the table element containing the td
|
Advert | |
|
06-17-2011, 02:44 AM | #6 |
Guru
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
|
Thank-you! So simple and it works! I set
table { font-size:1em } and now the TD elements scale as expected. The only point to watch out for is nested tables as the scaling is progressive, but since I'm not nesting them this is not an issue. |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Epub Font Size Question | Amalthia | Calibre | 15 | 01-03-2011 01:20 PM |
PRS-900 ADE and 900 and Acrobat Reader show same PDF differently | jswinden | Sony Reader | 7 | 06-30-2010 11:43 PM |
epub font size on 505 | Waltarro | Calibre | 0 | 03-05-2010 12:13 AM |
Increase font size of epub? | pennpin | PocketBook | 0 | 11-25-2009 05:41 PM |
font size in lrf viewer | harinezumi | Calibre | 2 | 03-10-2009 04:38 AM |