View Single Post
Old 05-02-2017, 05:17 AM   #2
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
Quote:
Originally Posted by TuxGirl View Post
I have been following the instructions at this post:
https://www.mobileread.com/forums/sh...48&postcount=8

If I use the KoboTouch driver, I seem to be able to get a monospace font in the Font Family Defaults test file, but when I use the KoboTouchExtended driver, I don't seem to be getting the monospace font. Is that normal? Is everyone generally using straight epubs if they want to have monospace fonts?!
The KePub reader is very different from the ePub reader in the way it handles fonts.

The main problem with the KePub reader is that if you select a font from the device menu then it will override all other fonts in the book. So without patching the firmware the only way to have a monospace font in a KePub is either to select "Publisher default" from the menu (so only fonts set by the book's publisher are used), or select a sideloaded monospace font from the device menu (in which case the whole book will be displayed in monospace.)

The ePub reader is different, it allows you to select a font from the device menu but still allows the publisher to override the selected font in the ebook, so if the publisher has done it right then you can have your own choice of font for the main text but still have some things displayed in other font faces, such as monospace for computer code etc.

If you are willing to patch the firmware then you can make it so the KePub reader doesn't override all of the publisher's fonts when you select a font from the device menu, the relevent patch is called `Un-Force user font-family in KePubs`.

(There is also a patch for the ePub reader called `Default ePub monospace font (Courier)` that makes the device use a sideloaded Courier font as the default monospace font, which avoids the need to use @font-face to define the monospace font in the ePub book's stylesheet as the link you gave above was doing.)

Edit: If you have selected "Publisher default" in a KePub and the monospace font is still not being displayed, then perhaps the method of defining @font-face:monospace doesn't work in KePubs. The KePub reader has its own definition and uses the default sans-serif font (Avenir Next) when font-family:monospace; is specified, and I'm not sure if that overrides the publisher's definition or not. You might need to replace "font-family:monospace;" with "font-family:Courier,monospace;" in the book for it to work in KePubs. (Assuming you have a monospaced font called Courier installed on the device.)

Last edited by GeoffR; 05-02-2017 at 06:06 AM. Reason: "Publisher default"
GeoffR is offline   Reply With Quote