View Single Post
Old 07-17-2013, 02:03 PM   #10
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,597
Karma: 169712392
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by GeoffR View Post
This is my guess about what is going on with the font size and line spacing:

As tshering noted above, the Kobo readingLineHeight set by the slider is in units of em. But it does this based only on the font size at body level, and does not scale the value properly properly at lower levels.

For example if the CSS font-size at body level is the default 1.0em and readingLineHeight is at its minimum setting of 1.3, then the line-height at paragraph level is the inherited value 1.0em*1.3 = 1.3em instead of the unitless value 1.3, which I think is a Kobo bug.

Thus if font-size is set at paragraph level to a value different to the body level, then the inherited line-height is incorrect. For example if font-size is 1.0em at body level and 1.2em at paragraph level then the inherited line-height should be 1.3*1.2em = 1.56em, but because of the bug it is actually just 1.3em. This is the bug we can exploit to reduce the minimum line spacing without resorting to setting line-height expliitly in CSS (which would make it non-adjustable).
Strictly speaking, line-height can be used several ways. If it is unitless, it is used with the current font size so line-height: 1.2 and font-size: 1em would give 1.2em as the line height. Percentage line-heights work the same way as a multiplier for the font size. If the line height is set with a unit (em, cm, px, pt, etc.), it becomes an absolute value regardless of the font size so you get to see large font sizes overlap and small font sizes look lonely in a sea of white space. You can also set line-height as normal which generally is equivalent to line-height: 1.2/120% or 1.3/130% depending on the implementation.

My preference is for using an unitless setting so when I change the font size, the line height automatically changes.

Regards,
David
DNSB is offline   Reply With Quote