View Single Post
Old 12-23-2020, 03:02 PM   #3
maraskan_user
Member
maraskan_user began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Dec 2020
Location: Germany
Device: Boox Nova 3, Galaxy Tab S6, Samsung M21
Hello Mr. Goyal,

thank you for your answer! I'm still somewhat confused due being new to this topic. I'm trying to grasp both Calibre's as well as KOreader's scaling and font size settings and nomenclature. I'll try to write down what I've found so far, maybe it helps some other confused soul.

There seem to be 3 factors to the equation of font sizing:
1. the DPI setting of the system. Neccessary to calculate the relationship between PX and PT values, basically PX = PT*(DPI/72).
2. a user configurable default font size for text without size specifications.
3. a user configurable arbitrary scaling factor to zoom all elements bigger and smaller

For 1, I guess the DPI value can mostly be ignored for Calibre, since it's determined by the hardware and handled automatically. KOreader has a slightly harder job, since it runs on a lot of different platforms and not always detects the system's DPI properly, so it offers a user configurable override setting for DPI that it calls "Screen DPI". ("Auto DPI" doesn't work for my Android systems...) So it needs this user override.

For 2, The setting for the default font size for text without size specifications in the Calibre Editor in Preferences->Preview Settings is called "Default Font Size", in KOreader it's called "Font Size" in the bottom menu. They both affect elements that use EM values for sizing. If a document contains text both with specified and with unspecified size, this setting determines the size ratios between them.

For 3, Calibre Editor doesn't really need a zoom factor, since it's an editor. It will just show what's there. KOreader offers a "Zoom (DPI)" setting, but weirdly it only affects EM elements, not text elements sized by PX and PT values. I need to look into this further.

In Calibre Viewer, it works differently. It offers a setting called "Font Size", which changes the default font size for text without size declarations, but it zooms rescales the size of text with PT or PX size declarations. Since there is only one setting for two jobs (default font size + zoom), something does get lost, in this case the ability to specify the size ratio between EM and PT/PX declarations.

...which caused my confusion in the first post, since I assumed that setting the "Font Size" to 18 in the Viewer would size 1em text at an effective 18px (at 96 DPI), which it does, but at the same time it resizes actual 18px text to something bigger. I'm assuming that, since 16 px is said to be the default font size used by most browsers when no font size is specified in an html document, scale everything by factor (BaseFontSize/16), which makes a lot of sense, now that I think about it.
maraskan_user is offline   Reply With Quote