View Single Post
Old 04-28-2017, 11:48 AM   #2
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
Posts: 1,759
Karma: 731681
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
Yes, it's a known bug: https://github.com/koreader/koreader/issues/1010

pt isn't recommended for on-screen display but obviously the present situation is rather stupid regardless. The browser method of 1em = 12pt = 16px = 100% seems like a fairly reasonable default even if it's technically against the spec because px is a relative value while pt is absolute. I suspect it's currently undefined in order to wait for a proper solution, which is something we'd probably be able to do as well.

So the simple solution: pt_value/12*base_px

The complex solution (but possibly not that complex): use DPI to actually calculate the physical size of 12pt — however, on devices like cellphones doing so would actually result in an inferior experience… which is of course why pt isn't recommended for on-screen display in the first place. So I think the easier solution actually sounds best.

Edit: actually looking at it a bit more I think hwhw might've been mistaken

https://github.com/koreader/crengine...rend.cpp#L1876 seems to do what I suggest

In that case the issue must be something slightly different.

Last edited by Frenzie; 04-28-2017 at 11:57 AM.
Frenzie is offline   Reply With Quote