Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Sony Reader > Sony Reader Dev Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 12-08-2021, 09:18 AM   #1
gingerbeardman
Zealot
gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.
 
gingerbeardman's Avatar
 
Posts: 125
Karma: 1001024
Join Date: Apr 2010
Location: Cornwall, UK
Device: Various Sony Readers, Kobo Touch Edition, iPhone
Lightbulb 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
Attached Thumbnails
Click image for larger version

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

Last edited by gingerbeardman; 12-08-2021 at 09:23 AM.
gingerbeardman is offline   Reply With Quote
Reply

Tags
css, fonts, prs, sony

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Script] Koboify Fonts sherman Kobo Reader 112 08-23-2020 12:00 PM
Controlling Font Sizes for Different Sets of Fonts in Calibre mactuary Calibre 1 05-05-2020 07:46 AM
GUI Plugin help for Custom Export Script iomari Plugins 4 10-28-2011 10:09 AM
Custom margin sizes for PE e-ink side w/ epub books? gerhardtfischer enTourage eDGe 3 09-27-2011 07:00 PM
Touch Fonts question (special characters in stock and custom fonts) levil Kobo Reader 20 09-23-2011 02:51 PM


All times are GMT -4. The time now is 11:00 AM.


MobileRead.com is a privately owned, operated and funded community.