View Single Post
Old 06-16-2020, 07:47 AM   #17
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,960
Karma: 146918083
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Jim Chapman View Post
You might not like px for font size, but per the CSS spec, it is allowed. See here: https://www.w3.org/TR/CSS21/fonts.ht...pdef-font-size and note the link to <length> which includes 'px' in the valid ways to define a font-size.

As for % figures, they are normally relative to the font-size of the parent element. I'd be cautious about assuming how any particular reading system will default that, though obviously if no element in the 'child->parent' hierarchy specifies a font-size, it would be reasonable to use the user's preferred font-size.

'em' figures are rather the same - they are normally calculated based on what this element's em-size would otherwise be, which is to say, the parent's size. So '140%' and '1.4em' mean basically the same thing.

I say 'normally' because some elements (h? for instance) define their own way of getting a default value, which will be used if no other font-size value is provided.

I wouldn't expect every reading system to implement all these rules dependably, so if you really care about controlling the font size of your publication, 'px' might actually be the best measure. The CSS spec (linked above) defines a pixel thus:
The reference pixel is the visual angle of one pixel on a device with a pixel density of 96dpi and a distance from the reader of an arm's length. For a nominal arm's length of 28 inches, the visual angle is therefore about 0.0213 degrees. For reading at arm's length, 1px thus corresponds to about 0.26 mm (1/96 inch).
I won't use px because I want to be able to change the font size. px is fixed and em is no. So for an eBook, px is not a good idea. it's not up to the publisher to decide what font size we use. One of the reason some read eBooks is to be able ot use a large enough font size to be able to read. a fixed size font will most likely not be large enough.
JSWolf is offline   Reply With Quote