Custom fonts in 2020
Hi!
I just bought my first Kobo (Libra H2O) and so far mostly like what I got. Except that I can't figure out how to make custom sideloaded fonts work. There's a number of threads discussing this topic, but most of them seem to be 5+ years old and either don't apply to the new devices or I am skipping some essential step.
What I am trying to achieve is to define three font families, one for regular text, one for sans-serif text and one for monospaced text, and have Kobo display text in any of these font families. To do so I uploaded the necessary font files, renamed so that the filename matches the internal font name, to the device's [root]/fonts directory and created a stylesheet which would reference these fonts using the url(res:///fonts/FontName.ttf) syntax. I am using the stock reader with "Publisher's default" as the selected font.
But I still can't get a proper display. I keep modifying my HTML code in any way I can think of, but most of them simply ignore my fonts, or perhaps display one font family correctly but not the others. I even tried switching from res:/// to file:///mnt/onboard, but without any success. What I would very much appreciate is:
a) either for someone who managed to get the fonts working to take a look at my files and tell me what I am doing wrong. Attached is a sample book file along with the source code and the Gentium Plus font file (the other two are simply renamed Arial and Courier New files from Windows XP).
b) or getting a set of files which work. It doesn't matter which fonts are used, as long as they are external and available, it doesn't matter what the content of the book file is. As long as I have a working example, I trust that I can adapt it to my needs.
Later one, I expect more struggle as I will be trying to get small caps to work as well, but that's step #2. For now, I need to get functioning fonts.
Thanks for any help.
|