Quote:
Originally Posted by JSWolf
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.