View Single Post
Old 05-23-2019, 04:44 PM   #6
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 lumpynose View Post
Ok, thanks.

I've figured out my problem in the second question, e.g., where I needed to use bitter bold for the strong and b tags.

I'm not sure if you're answering my other, which is now an admittedly new question: if I have a class courgette as in my first example which uses an embedded font and there are no other @font-face or font-family things in my css, will the body font be Georgia? On the kobo using its reader I don't see any way to change that except to use an embedded font. On the other hand, with koreader, it does what I think is the right thing which is you can pick which font you want for the body font, when it's not specified in the css and you're using embedded fonts for just a class (e.g, a dingbat font or my courgette example).

In other words, assume my first example with courgette is all that there is. Won't the other text be in Georgia?
With Kobo, font-related questions can be a bit tricky to answer simply. The answer often varies depending on whether you're talking about a kepub or a standard epub. In fact you could probably write a small tome about it

I know nothing about Koreader but, in general, if there are no @font-face and no font-family in your CSS then all text will be displayed in the font you choose from the Aa pop-up, which can be a built-in font or a sideloaded one.

Both the kepub and the epub renderers have their own override CSS file which is used in conjunction with your Aa Font Face choice and the book's own CSS file. These 2 override CSS files (userStyle.css for epub, kepub-book.css for kepub) are not the same. The kepub one is more aggressive in its overrides than the epub one.

I'm not 100% sure about this, but I think that if you choose the 'Publisher Default' font then the override CSS file is not used.

It isn't actually true to say that you MUST choose 'Publisher Default' if you have any embedded fonts because it depends on where the embedded fonts are applied.

ETA: The following strike-through info about font-family is true for plain epub but not kepub ...

For example, if you have a fancy embedded font used only for headings (h1, h2 etc) then there is usually no need to choose 'Publisher Default'. You can quite happily select any font you like from the Aa menu to display your main body text and the headings will still display in the fancy font.

Similarly, if you apply the fancy font in a <span> class, as per your Courgette example, you should also not need to choose 'Publisher Default'.

It gets more tricky if you have <p class="courgette"> because, by default, both the epub and kepub override CSS's will zap it in favour of your Aa menu choice. In this case you would need to choose 'Publisher Default'.



If you want to embed a font to be used for <body>, as per your Bitter example, then I'm pretty sure you do need to select 'Publisher Default' because both override CSS files will zap your body font-family if you don't. At this point, I have to confess that I have no idea why any Kobo user would want/need to embed a body font when it's so easy to sideload fonts.

If the default override CSS files, for either epub or kepub, are causing you grief (as they do me) there are various Kobo patches available to bend them to your will. I won't elaborate right now.


Have you lost the will to live yet ...? If not ... about the generic values for font-family:serif or sans-serif or monospace ...

Once again, what you get depends on whether you're using epub or kepub.

For epub these are hard-coded in the firmware as Georgia, Avenir and CourierStd respectively. As CourierStd does not exist on the Kobo it seems an odd choice! If you want to see a monospace font you need to take action. You could embed one if you insist but, once again, the Kobo patching system offers a much simpler solution. If we can see the firmware code we can patch it, so it's fairly easy to change these 3 generic fonts to our 3 favourites (built-in and/or sideloaded).

I don't think anyone has found (yet) kepub equivalent patchable code for these generic font-family values but I think serif and sans-serif probably default to the same Georgia, Avenir as epub. I can't remember what monospace will display - probably Georgia or Avenir, I can't remember which. Whatever it is it won't be an actual monospace font.

I could go on and on, but I think I'll stop now

Last edited by jackie_w; 05-23-2019 at 07:55 PM.
jackie_w is offline   Reply With Quote