Quantcast
Channel: MobileRead Forums - Sony Reader
Viewing all articles
Browse latest Browse all 1291

PRS-650 Script to produce better sizes for custom fonts

$
0
0
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

Attached Thumbnails
Click image for larger version

Name:	Screen shot 2021-12-08 at 13.06.35.png
Views:	N/A
Size:	701.0 KB
ID:	190695  

Viewing all articles
Browse latest Browse all 1291

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>