View Single Post
Old 12-17-2019, 03:20 AM   #1
rtiangha
Evangelist
rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.
 
Posts: 495
Karma: 356531
Join Date: Jul 2016
Location: 'burta, Canada
Device: Kobo Glo HD
How do I manually specify the fallback fonts for sans-serif, serif, monospace, etc.?

Based on hobnail's suggestion to test generic font families in DomesticExtremis's EPUB Feature Peeker thread, for fun, I modified the epub to add a section that outputted text solely using the generic font families of serif, sans-serif, monospace, cursive and fantasy (ex. { font-family: sans-serif } ) to see how KOReader would handle it.

Now, I know that the algorithm is for KOReader to use any fonts explicitly defined if it exists in the font folder or if it's embedded in the epub, and fallback to a single font if all of that fails. But I was wondering if it was possible to set the fallback fonts for the other generic font families explicitly?

For example, it looks like monospace is set properly and it is pulling a monospace font from somewhere (either Droid Sans Mono or Nimbus Mono; I can't tell), but it doesn't do it for the other generic font families (so if I have Charis SIL set as my default font (which is serif), it'll also use it for text set to use generic sans-serif if no other specific font is specified).

Having no explicit fallback font for Fantasy and Cursive I can understand, but as KOReader ships with a variety of serif and sans-serif fonts by default, at the very least, it should be safe to define specific fonts to fallback on for those generic families. Is there a place that I can specify that where it won't get over-written when KOReader gets updated, and if so, where? I'm assuming it'd be a CSS thing unless there's a specific KOReader application option somewhere that I'm missing?

Last edited by rtiangha; 12-17-2019 at 03:28 AM.
rtiangha is offline   Reply With Quote