Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > KOReader

Notices

Reply
 
Thread Tools Search this Thread
Old 12-17-2019, 04:20 AM   #1
rtiangha
Addict
rtiangha knows more than wikipediartiangha knows more than wikipediartiangha knows more than wikipediartiangha knows more than wikipediartiangha knows more than wikipediartiangha knows more than wikipediartiangha knows more than wikipediartiangha knows more than wikipediartiangha knows more than wikipediartiangha knows more than wikipediartiangha knows more than wikipedia
 
Posts: 217
Karma: 47685
Join Date: Jul 2016
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 04:28 AM.
rtiangha is online now   Reply With Quote
Old 12-17-2019, 11:35 AM   #2
pazos
cosiñeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 313
Karma: 300001
Join Date: Apr 2014
Device: BQ Cervantes 4
AFAIK there's only one fallback font defined by the user and is used to render glyphs that can't be rendered by your default font.

Feel free to open a question on github, where these kind of questions are more than welcome.
pazos is offline   Reply With Quote
Old 12-17-2019, 01:22 PM   #3
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 9,609
Karma: 17000000
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O & Forma
IIRC, we've covered the subject somewhat in a few possibly-completely-unrelated PRs in CRe ^^. Look for stuff from @poire-z and me, at least.

The gist of it being: because reasons. (I think? ).
NiLuJe is offline   Reply With Quote
Old 12-17-2019, 02:33 PM   #4
rtiangha
Addict
rtiangha knows more than wikipediartiangha knows more than wikipediartiangha knows more than wikipediartiangha knows more than wikipediartiangha knows more than wikipediartiangha knows more than wikipediartiangha knows more than wikipediartiangha knows more than wikipediartiangha knows more than wikipediartiangha knows more than wikipediartiangha knows more than wikipedia
 
Posts: 217
Karma: 47685
Join Date: Jul 2016
Device: Kobo Glo HD
Quote:
Originally Posted by NiLuJe View Post
IIRC, we've covered the subject somewhat in a few possibly-completely-unrelated PRs in CRe ^^. Look for stuff from @poire-z and me, at least.

The gist of it being: because reasons. (I think? ).
Good technical reasons rather than purely philosophical I hope, lol? :P

I was rather surprised that on my Kobo device, it'd pull its default of Georgia/Avenir Next for generic serif/sans serif when set to Publisher's Default, but couldn't pull a monospace one for kepubs (of course, the whole monospace thing being a known point of contention on Kobo at the moment, lol). I was hoping KOReader could do all three, at least.

I just figured that if the monospace font was set somewhere, there's no reason why any of the other generic font families couldn't be set either, (certainly for serif and sans-serif since some already ship in the stock distribution, although I'm sure there are some nice Open SIL fonts out there that could serve as generic fallbacks for cursive and fantasy too; Calibre on my Windows machine seems to pull Comic Sans and Impact for those respectively, which I found funny). I do understand the need for a single fallback font for when absolutely all else fails, though (one of the Notos being a good choice).

Last edited by rtiangha; 12-17-2019 at 02:38 PM.
rtiangha is online now   Reply With Quote
Old 12-19-2019, 06:54 AM   #5
Frenzie
Guru
Frenzie knows how to choose the perfect melonFrenzie knows how to choose the perfect melonFrenzie knows how to choose the perfect melonFrenzie knows how to choose the perfect melonFrenzie knows how to choose the perfect melonFrenzie knows how to choose the perfect melonFrenzie knows how to choose the perfect melonFrenzie knows how to choose the perfect melonFrenzie knows how to choose the perfect melonFrenzie knows how to choose the perfect melonFrenzie knows how to choose the perfect melon
 
Posts: 857
Karma: 137024
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
Quote:
Originally Posted by rtiangha View Post
Good technical reasons rather than purely philosophical I hope, lol? :P
I wouldn't be inclined to call them good (it almost feels like a temporary hack to me in the way it works), but these things basically come down to the fact that CREngine implemented something a certain way and that's just the way it is unless someone puts in some (possibly quite serious) effort.
Frenzie is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Serif, and sans-serif fonts SamL ePub 5 07-21-2011 07:00 PM
Which typeface should use for ebook, Serif or Sans-serif droople Workshop 8 06-13-2010 08:20 AM
Serif and Sans-Serif fonts in Libprs500 benong Calibre 1 02-06-2008 05:43 AM
Switching fonts from Sans to Serif TOucan iRex 4 07-16-2007 12:27 PM
Do you prefer the Reader's serif or its sans serif font? (poll) Alexander Turcic Sony Reader 9 11-25-2006 01:15 PM


All times are GMT -4. The time now is 11:43 PM.


MobileRead.com is a privately owned, operated and funded community.