View Single Post
Old 04-29-2015, 12:52 PM   #21
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
Quote:
Originally Posted by GERGE View Post
By the way, sometimes changing the line spacing value only one step does no difference when used with fixed top/bottom margins. This is expected, I guess, but maybe you could touch on this in the fixed margins and line spacing comments.
Yes it is expected, but I think it is related mainly to the choice of font size. This is a guess, but I think the way the line spacing from the slider relates to the line height (in px) on screen is:

(font size) * (base line height) * (slider value) rounded to nearest integer.

I don't know what the base line height is, but I guess something like 1.3. So it you start at the middle of the slider with the default patch values, and increase the line spacing one notch at a time you would get something like this:

38px font size:
38 * 1.3 * 0.90 = 44.46 ~= 44px
38 * 1.3 * 0.92 = 45.45 ~= 45px
38 * 1.3 * 0.94 = 46.44 ~= 46px
38 * 1.3 * 0.96 = 47.42 ~= 47px
38 * 1.3 * 0.98 = 48.41 ~= 48px
38 * 1.3 * 1.00 = 49.40 ~= 49px

28px font size:
28 * 1.3 * 0.90 = 32.76 ~= 33px
28 * 1.3 * 0.92 = 33.49 ~= 33px
28 * 1.3 * 0.94 = 34.22 ~= 34px
28 * 1.3 * 0.96 = 34.94 ~= 35px
28 * 1.3 * 0.98 = 35.67 ~= 36px
28 * 1.3 * 1.00 = 36.40 ~= 36px

These examples are just made up, I haven't the patience to test it. But you can see with the smaller font size the line spacing would repeat fairly often, because the increase is quite a bit less than one pixel.

The solution, if it bothers you, is to change the patch replacement values ... 0.90, 0.92, 0.94, 0.96, 0.98, 1.0, ... and make the gaps between values larger, say ..., 0.90, 0.925, 0.95, 0.975, 1.0, ...

The default values in the patch, like most of the others, were just what worked for me on my Glo.

(Edit: The above applies to the kepub reader, and to the epub reader if the `Unitless ePub line height` patch is enabled. The unpatched epub reader uses a line height which is not proportional to font size.)

(Edit2: If my guess about how it works is correct, then the way to choose the minimum gap between the line spacing slider values would be to calculate: 1.0 / (1.3 * your favourite font size in px), e.g. if my favourite font size is 35px, then the gap to use would be 1.0 / (1.3 * 35) = 0.022 )

Last edited by GeoffR; 04-29-2015 at 02:17 PM. Reason: Calculate minimum slider value gap from favourite font size
GeoffR is offline   Reply With Quote