View Single Post
Old 06-08-2023, 06:35 AM   #17
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,796
Karma: 146391129
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by jackie_w View Post
What you're missing is that those 4 CSS @font-face statements are completely wrong for monospace on a Kobo. I don't know why @JSWolf recommended them to you. They might have helped a user of a Sony eink device circa 2010 but they are of no use to a Kobo device of any vintage.

Assuming that you're using one of the stock Kobo reading apps (i.e. not KOReader) then the following is the way to get a monospace font working on any Kobo firmware >= 4.32.xxxxx:

Epub:
  • You don't need any CSS extra @font-face statements.
  • To be on the safe side rename the 4 sideloaded .ttf files so they have external filenames:
    Courier-Regular.ttf (or Courier.ttf)
    Courier-Italic.ttf
    Courier-Bold.ttf
    Courier-BoldItalic.ttf
  • The *internal* font name of all 4 ttfs must be precisely Courier, i.e. none of these is suitable Courier New or Courier Prime or Dark Courier. If your current sideloaded font isn't internally named Courier then you need to use some kind of font editor (e.g. FontForge) or some other font utility (e.g. ttfedit) to change the internal font name to exactly Courier.

Kepub:
Ever since firmware 4.32.xxxxx, the only option is to embed a monospace font into each book that needs it. If you embed the font then it should work equally well as either epub or kepub.
That code was what I used with ePub on Kobo before 4.32. It does work. But the OP was using it with KePub.
JSWolf is offline   Reply With Quote