Thread: Embedded fonts?
View Single Post
Old 07-14-2011, 08:36 AM   #66
rashkae
Addict
rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.rashkae ought to be getting tired of karma fortunes by now.
 
rashkae's Avatar
 
Posts: 280
Karma: 261602
Join Date: Jun 2011
Location: Ontario, Canada
Device: Kobo Aura HD
It's very simple really. The Kobo overwrites the body font-family with either 'serif' or 'sans-serif', which is how they allow the user to choose a font face. For all intents and purposes, the .css code is appended.

If you want and e-book on the kobo to display an embedded font (defined in the .body), then you must use css codes that aliases those fonts. I've had to do this to fix books that use unusual characters that were not included in the original fonts (and would therefore display as ?)

Ex:

@font-face {
font-style: italic;
font-family: 'Liberation', serif, sans-serif;
font-weight: normal;
src: url(../Fonts/LiberationSerif-Italic.ttf);
}
@font-face {
font-style: normal;
font-family: 'Liberation', serif, sans-serif;
font-weight: normal;
src: url(../Fonts/LiberationSerif-Regular.ttf);
}
@font-face {
font-style: italic;
font-family: 'Liberation', serif, sans-serif;
font-weight: bold;
src: url(../Fonts/LiberationSerif-BoldItalic.ttf);
}
@font-face {
font-style: normal;
font-family: 'Liberation', serif, sans-serif;
font-weight: bold;
src: url(../Fonts/LiberationSerif-Bold.ttf);
}

I've not really tested this much yet, but I believe the Kobo touch, (at least, up to 1.9.4 firmware) allows embedded fonts to work without the hack. The trade-off, however, is that you can not set user font prefernences in those books.
rashkae is offline   Reply With Quote