Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Devices

Notices

Reply
 
Thread Tools Search this Thread
Old 06-16-2011, 04:15 PM   #1
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
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.
Agama is offline   Reply With Quote
Old 06-16-2011, 06:07 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Agama View Post
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.
1.5 * 1.5 = 2.25

The question is: does the scale apply to the base font size or the inherited font size?
theducks is offline   Reply With Quote
Advert
Old 06-16-2011, 07:58 PM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,776
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.
kovidgoyal is offline   Reply With Quote
Old 06-17-2011, 02:02 AM   #4
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
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
Agama is offline   Reply With Quote
Old 06-17-2011, 02:36 AM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
set a font size on the table element containing the td
kovidgoyal is offline   Reply With Quote
Advert
Old 06-17-2011, 02:44 AM   #6
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
Quote:
Originally Posted by kovidgoyal View Post
set a font size on the table element containing the td
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.
Agama is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 09:00 PM.


MobileRead.com is a privately owned, operated and funded community.