View Single Post
Old 06-15-2014, 05:30 PM   #20
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 Jellby View Post
Do you know where this 'res:///fonts' directory is located? Can it be accessed from outside the reading app? Could possibly an external CSS file be placed there and used with an @import rule?
Depending on what you're trying to do, you can directly reference the res:///fonts directory from css @font-faces inside standard epubs (not sure about kepubs).

For instance, Kobos don't have a built-in monospace font and I actively avoid embedding fonts, so I've used this method when I want to reference a sideloaded monospace font for selected css classes only (e.g. code snippets). The same method works when a true small-caps font is desirable.

It may not be relevant for your purposes, but just in case, here's a sample bit of css:
Spoiler:
Code:
@font-face {font-family: monospace; font-weight: normal; font-style: normal; src: url("res:///fonts/normal/Dark Courier")}
@font-face {font-family: monospace; font-weight: bold; font-style: normal; src: url("res:///fonts/bold/Dark Courier")}
@font-face {font-family: monospace; font-weight: normal; font-style: italic; src: url("res:///fonts/italic/Dark Courier")}
@font-face {font-family: monospace; font-weight: bold; font-style: italic; src: url("res:///fonts/bolditalic/Dark Courier")}

FWIW, I also tried very hard to find a way to reference an on-device custom css file using an @import. No joy, I'm afraid. I'm not sure why it doesn't work because it works fine on other 'Adobe-style' readers like the Sony and even the Mantano android reading app.

The nearest I could get to a custom css file stored on the Kobo was this option in the calibre Kobo driver.

ETA: I have been using the Kobo driver method, for many months, to force custom @page margins as GeoffR's new patch wasn't available when I transferred all my books. If/when I next need a factory reset, this patch seems like the better option.

Last edited by jackie_w; 06-15-2014 at 05:42 PM.
jackie_w is offline   Reply With Quote