View Single Post
Old 09-29-2019, 06:03 PM   #2
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 hulabula View Post
Hello,

I have created an e-book in which I would like to use an embedded font for some parts of the text.
I have the following in a css file:

@font-face {
font-family: "Open Sans";
font-weight: normal;
font-style: normal;
src: url(../Fonts/OpenSans-Regular.otf);
}

This is used as follows:

.sansserif {
font-family: "Open Sans", sans-serif;
}

I created the e-book with Sigil. The preview in Sigil works, it also works in Calibre. But when I copy the e-book to my Kobo reader (Aura H2O 2nd edition), only one font is used. Not the special one I embedded, and not the fallback sans-serif font, but the "default" serif font I use for all the other text in the book.
This is my first self-created e-book, and I don't have a different e-reader to test with. So I have no comparisons.

What could be the problem here?

Thanks for any help!
Kobo supports sans-serif. So you don't need to embed a sans-serif font. Just use...

Code:
font-family: sans-serif;
in the classes you want a sans-serif font.

As for your CSS code, it looks good unless it's your pointer to the font file.
JSWolf is offline   Reply With Quote