View Single Post
Old 06-27-2013, 10:54 AM   #12
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 il_mix View Post
Nope, I don't get it...

I've installed a monospace font (Dark Courier), and I can select it in my Kobo.
...
But everything will still be displayed with the same font...
I didn't embed the font since it is already on the Kobo. By the way, if I embed it I get anything but the code in Dark Courier, again.

SIDE NOTE: I have the 2.6.1 firmware
You were actually closer with your original code. You'll be pleased to know that the solution is quite simple. Your problem is that you have not included the necessary @font-face css statements. Try replacing your style section with this before doing your calibre conversion:
Code:
<style type="text/css">
@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")}
pre {
  background: #eeeeee;
}
code {
  font-style: monospace;
}
</style>
You will also notice that I removed your body {font-family:...} statement. In general, if you are going to be reading the epub on a Kobo, it is better (IMO) to let the user choose the main body font from the Kobo select-a-font list. Those who prefer sans-serif can select a sans-serif font and those who prefer serif can pick a serif. However, if you really want to try to force sans-serif then the correct statement would be:
body {font-family: sans-serif} i.e. all lowercase.

Hope this helps

Last edited by jackie_w; 06-27-2013 at 10:58 AM.
jackie_w is offline   Reply With Quote