Below are details of a script to generate custom CSS to make sure custom fonts all appear at similar sizes when they are used as the display fonts on Sony Readers running PRS+ custom firmware. Without this script certain custom fonts will appear much bigger or smaller than others.
I use this with my PRS-650, but it probably applies to most Sony Readers and perhaps some other eReaders. Get in touch if you have an idea how it can apply to other eReaders.
sudo -H python -m ensurepip sudo -H pip install font-line
Script should be alongside the folders of font families in
Run from the command line without any arguments.
One custom CSS file for each font family is written to
How does it work?
Using the python tool font-line I get the sum of Ascender+Descender from the font metrics for each family. Dividing 1 by that number normalises the font size by making larger fonts slightly smaller, and smaller fonts slightly larger. The script finally writes the new size information into the CSS in the expected format at the correct location.