12-08-2021, 08:18 AM | #1 |
Zealot
Posts: 129
Karma: 1001024
Join Date: Apr 2010
Location: Cornwall, UK
Device: Various Sony Readers, Kobo Touch Edition, iPhone
|
Script for better relative sizing of custom fonts
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 Last edited by gingerbeardman; 12-08-2021 at 08:23 AM. |
Tags |
css, fonts, prs, sony |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Script] Koboify Fonts | sherman | Kobo Reader | 137 | 10-21-2024 08:21 AM |
Controlling Font Sizes for Different Sets of Fonts in Calibre | mactuary | Calibre | 1 | 05-05-2020 06:46 AM |
GUI Plugin help for Custom Export Script | iomari | Plugins | 4 | 10-28-2011 09:09 AM |
Custom margin sizes for PE e-ink side w/ epub books? | gerhardtfischer | enTourage eDGe | 3 | 09-27-2011 06:00 PM |
Touch Fonts question (special characters in stock and custom fonts) | levil | Kobo Reader | 20 | 09-23-2011 01:51 PM |