View Single Post
Old 12-06-2017, 07:54 PM   #4187
gingerbeardman
Zealot
gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.
 
gingerbeardman's Avatar
 
Posts: 129
Karma: 1001024
Join Date: Apr 2010
Location: Cornwall, UK
Device: Various Sony Readers, Kobo Touch Edition, iPhone
Quote:
Originally Posted by JSWolf View Post
Can you make your font size normalization tool a Calibre Editor plugin?
Right now it is written in PHP and relies on a command line tool called font-line to access the font dimensions data. I should be able to convert into python and make a calibre plugin.

here's the code
https://gist.github.com/gingerbeardm...afee9829828ed1

i get the Ascender+Descender sum from the font metrics, and divide 1 by that number. This normalises the values to make the larger fonts smaller and vice versa. Then I just write that data into the CSS.

I'd have to look into how calibre handles ebook CSS to make sure my approach is general enough.

Last edited by gingerbeardman; 12-06-2017 at 08:01 PM.
gingerbeardman is offline   Reply With Quote