Quote:
Originally Posted by jackie_w
I think the quotes in the url are only needed if there are spaces in the address so I'm not sure that matters.
Nevertheless I'll try Consolas myself and see what happens. Were you using the Consolas ttf files included in Windows 7? These are the only ones I have access to.
|
Either that or the Office 2010 ones, not sure which one is taking precedence on my system.
Quote:
Originally Posted by jackie_w
@dmapr,
Consolas seems OK to me - see attached photo ( excuse poor camera work). I don't think there's anything wrong with your @font-faces - the quotes got auto-stripped from my urls too by the time they reached the Kobo.
This is a copy/paste from my kobo_extra.css:
Code:
@font-face {font-family: monospace; font-weight: normal; font-style: normal; src: url("res:///fonts/normal/Consolas")}
@font-face {font-family: monospace; font-weight: bold; font-style: normal; src: url("res:///fonts/bold/Consolas")}
@font-face {font-family: monospace; font-weight: normal; font-style: italic; src: url("res:///fonts/italic/Consolas")}
@font-face {font-family: monospace; font-weight: bold; font-style: italic; src: url("res:///fonts/bolditalic/Consolas")}
Just a thought: were you using a standard epub or was it a kepub? I've only ever managed to get css font-family:monospace and font-family:sans-serif working properly in standard epubs. With kepub I suspect embedding is the only answer - but I could be wrong  .
Just a thought #2: Did you remember to do a full power off/on after adding the Consolas ttf files?
ETA:
Just a thought #3: There is also the possibility that your particular epub is falling foul of the fudge code in the Kobo nickel firmware which tries to make sure that the font you select from the Font menu list is applied despite the epub internal css code. Unless you've taken steps against it, if your epub code looks like this:
Code:
<p class="mono">blah ... blah ...</p>
and
Code:
.mono {font-family: monospace}
the Kobo "helpfully" overrides all <p>s with the font chosen in the Font menu. It may be helpful for many users but it causes me nothing but trouble.
However, if your epub code looks like this:
Code:
<p class="whatever"><span class="mono">blah ... blah ...</span></p>
and
Code:
.mono {font-family: monospace}
that should always work OK.
If you use the Kobo Patcher, a better option is to prevent Kobo forcing font-family override on your <p> tags. There is an option you can enable in the libnickel.so.1.0.0.patch file near the bottom
Code:
patch_name = `Un-force font-family override p tags (std epubs)`
|
@jackie_w, thanks — tons of good info here. Yes, standard epub (not a kepub) and yes, the style is set on the p tag via a monospace class. I am using the patcher so I can look into enabling that option, assuming it's available for the version of firmware I use (3.1.1).
The most bizarre thing though is that the same exact CSS addition (the @font-face rules) added manually to the book's CSS makes the text render correctly, it only fails when the rules are appended from the kobo_extra.css during the transfer. The fonts have been on the reader forever and it's been power-cycled enough (the fonts do appear in the drop-down).
Also, the font that shows up when I use the kobo_extra.css appears to be neither Consolas nor the Amasis (the font chosen to render the text from the font selection menu).