View Single Post
Old 12-14-2019, 08:21 AM   #57
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by snarkophilus View Post
The book I have with the monospace font is a kepub. For now I've got GeoffR's modified Courier Prime font sideloaded, as well as Bookerly.

With the font set to either "Publisher Default" or Bookerly, even with the 'Un-Force user font-family in KePubs' patch applied, the only way I can get the book to display Courier GR is to have font-family: "Courier GR", monospace; in my CSS (guessing the ", monospace" isn't doing much here). Curiously, if I just use font-family: monospace; I see a sans-serif font instead of a monospace font for any text that is meant to be monospace (!?!).

From reading the post you linked to, I think I've done option 2 and that isn't working. Option 3 is working, but is the case I'm trying to avoid (needing to modify every epub).

Jackie - do you have just font-family: monospace; working for kepubs when using a side-loaded font as your chosen font (instead of "Publisher Default") with the current kobo firmware?
There's some confusion here, I think. The 3 items in my 'Getting monospace to work in kepubs' link are not options, they're steps, i.e. you have to do all 3 to see monospace in kepubs.

If your book's CSS contains:
Code:
font-family: "Courier GR", monospace;
then the Kobo will respond to:
- the monospace value if you send-to-device as epub
- the "Courier GR" value if you send-to-device as kepub.

This is, indeed, a PITA for kepubs. It's unfortunate, but normal, behaviour. I also don't want to hard-code font-family names in my calibre library's master copy of the epub, especially if I want to change the mono font to something else later on.

My personal workaround for avoiding having to manually edit every epub individually was to hack my copy of the KoboTouchExtended plugin so that all occurrences of font-family:monospace; in a CSS file are auto-corrected to my mono-fontname-of-choice when sending kepubs via the calibre send-to-device. Whether this is a practical solution depends on where you're at with your new project of 'let's learn about calibre plugins'. [Hacking KTE to indulge your latest "bright ideas" can be quite addictive - but that's a story unsuited to this thread.]

BTW, kepubs displaying font-family:monospace; as sans-serif as default is also unfortunate, but normal, behaviour. It's been this way as long as I can remember.

Now that Kobo have made some effort, in 4.19, to improve the monospace situation for standard epubs, it's anyone's guess whether they'll do something for kepub in the near future. I'll believe it when I see it, but we live in hope.
jackie_w is offline   Reply With Quote