Quantcast
Channel: MobileRead Forums - Kobo Developer's Corner
Viewing all articles
Browse latest Browse all 1563

Replacing the default fonts

$
0
0
Hi,

I have an issue with the default fonts, some of them don't have polish characters builtin. Ironically, most/all serif fonts do, while sans-serif fonts don't (Avenir/Gill).

I don't want to sideload replacements because I need this for multi-font documents that do display a default serif/sans-serif/monospace fonts. For the EPUB renderer this isn't much of an issue, as we can binary patch librmsdk and force it to even use sideloaded fonts. I've managed to do this successfully (set my own sideloaded sans-serif and monospace fonts using res:///fonts/...).

The problem is KEPUB renderer that uses sans: Georgia and sans-serif: Avenir by default. The latter has no polish letters. It also doesn't have a default monospace font.

My questions:

1. Is it possible to patch libnickel.so to change KEPUB renderer's defaults for the serif/sans-serif and possibly add one for monospace? I had a quick look at the occurrences of those two font names in the binary but it's not as straightforward as in librmsdk.so. No mention of monospace either. Has someone managed to do so?

2. Is it possible to just replace the default .ttf files in /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts? I've tried doing that with 4 avenir.ttf files I extracted from Mac OSX, but it didn't work, avenir completely disappeared from the font menu and sans-serif became Georgia by default. Looking at the files in /usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts I've found they are not actually TrueType fonts. No idea what format is that. file unix tool says: "Avenir.ttf: data". FontForge doesn't recognize them either. What format are they in? Are there replacement Avenir fonts with polish characters available somewhere?

As a sidenote: I know that I can do all of this by editing book's css file and embedding my own fonts. I've done that successfully, but what I would like is to have sane defaults for the kepub renderer itself.

Any ideas?

Viewing all articles
Browse latest Browse all 1563

Trending Articles



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