Below are details of my script to generate custom CSS to make sure custom fonts all appear at around the same size when used to view books. Without this script some fonts appear much bigger than others.
I use this with 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.
It was written back in 2017 but I thought I'd revitalise it with its own thread.
source code
https://gist.github.com/gingerbeardm...afee9829828ed1
installation
Check requirements and dependencies at top of source code.
usage
Run from the command line without any arguments.
location
See attached screenshot to see the layout of the fonts folder.
Script should be alongside the folders of font families in /READER/fonts
output
One custom CSS file for each font family is written to /READER/database/system/PRSPlus/epub/
how does it work?
Using a python command line tool called font-line: 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 smaller fonts larger. Then I just write that data into the CSS in the required format.
plugin?
Previously it had been asked if this could be a Calibre plugin but I don't think it's suited to that. Firstly: it does not operate on epub files, and secondly: it would need to be rewritten in Python (I have no interest in doing that).
see also
NimbusMod Redux font
https://www.mobileread.com/forums/sh...d.php?t=292416
I use this with 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.
It was written back in 2017 but I thought I'd revitalise it with its own thread.
source code
https://gist.github.com/gingerbeardm...afee9829828ed1
installation
Check requirements and dependencies at top of source code.
usage
Run from the command line without any arguments.
location
See attached screenshot to see the layout of the fonts folder.
Script should be alongside the folders of font families in /READER/fonts
output
One custom CSS file for each font family is written to /READER/database/system/PRSPlus/epub/
how does it work?
Using a python command line tool called font-line: 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 smaller fonts larger. Then I just write that data into the CSS in the required format.
plugin?
Previously it had been asked if this could be a Calibre plugin but I don't think it's suited to that. Firstly: it does not operate on epub files, and secondly: it would need to be rewritten in Python (I have no interest in doing that).
see also
NimbusMod Redux font
https://www.mobileread.com/forums/sh...d.php?t=292416