Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 10-18-2014, 10:06 PM   #1
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: 37,706
Karma: 18475502
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Accessing fonts from CSS

Is there a way to reference fonts that are installed someplace on the Kobo Reader without actually embedding them? I ask because while you can use your choice of fonts, you cannot use more then one font family. So if I want true small caps (for example), I'd have to embed both font families. On 650 & T1, I can use CSS code to access the fonts installed on the Readers without having to embed them in the eBooks. Can I do this on a Kobo Reader using firmware 3.8.0?

Last edited by JSWolf; 10-19-2014 at 11:01 AM.
JSWolf is offline   Reply With Quote
Old 10-18-2014, 10:48 PM   #2
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 1,481
Karma: 2892196
Join Date: Nov 2012
Location: New Zealand
Device: Kobo Glo
Quote:
Originally Posted by JSWolf View Post
Is there a way to embed fonts that are installed someplace on the Kobo Reader without actually embedding them? I ask because while you can use your choice of fonts, you cannot use more then one font family. So if I want true small caps (for example), I'd have to embed both font families. On 650 & T1, I can use CSS code to access the fonts installed on the Readers without having to embed them in the eBooks. Can I do this on a Kobo Reader using firmware 3.8.0?
Yes, this post explains how to reference your sideloaded fonts from a book's stylesheet: http://www.mobileread.com/forums/sho...1&postcount=12
GeoffR is offline   Reply With Quote
 
Enthusiast
Old 10-18-2014, 10:50 PM   #3
jackie_w
Wizard
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: 2,841
Karma: 4200035
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"/AuraH2O
Quote:
Originally Posted by JSWolf View Post
Is there a way to embed fonts that are installed someplace on the Kobo Reader without actually embedding them? I ask because while you can use your choice of fonts, you cannot use more then one font family. So if I want true small caps (for example), I'd have to embed both font families. On 650 & T1, I can use CSS code to access the fonts installed on the Readers without having to embed them in the eBooks. Can I do this on a Kobo Reader using firmware 3.8.0?
Yes, you can. This is what I use for small-caps in the kobo_extra.css file used by calibre's KOBOTOUCH driver's 'Modify CSS' option
Code:
@font-face {font-family: "SCfont"; font-weight: normal; font-style: normal; src: url("res:///fonts/normal/Charis SIL SmCp")}
@font-face {font-family: "SCfont"; font-weight: bold; font-style: normal; src: url("res:///fonts/bold/Charis SIL SmCp")}
@font-face {font-family: "SCfont"; font-weight: normal; font-style: italic; src: url("res:///fonts/italic/Charis SIL SmCp")}
@font-face {font-family: "SCfont"; font-weight: bold; font-style: italic; src: url("res:///fonts/bolditalic/Charis SIL SmCp")}
My label "SCfont" can be anything you like as long as it matches what you've used in the epub's main css file.
The Charis SIL SmCp must match the font's internal and external name.
jackie_w is online now   Reply With Quote
Old 10-19-2014, 04:09 AM   #4
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 6,197
Karma: 4800739
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by JSWolf View Post
Is there a way to embed fonts that are installed someplace on the Kobo Reader without actually embedding them?
That's use or reference fonts, not embed.
Jellby is online now   Reply With Quote
Old 10-19-2014, 11:00 AM   #5
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: 37,706
Karma: 18475502
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Quote:
Originally Posted by Jellby View Post
That's use or reference fonts, not embed.
True that. My mistake.
JSWolf is offline   Reply With Quote
Old Today, 11:04 AM   #6
dmapr
Addict
dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.
 
Posts: 261
Karma: 90958
Join Date: Sep 2009
Device: PRS-950, Kobo Aura HD
A somewhat related question. I have tried to use the technique described by jackie_w to add monospace fonts and occasionally it would result in the book ignoring ALL CSS, while other books worked fine. Can anyone spot anything wrong with 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")}

pre, code, tt {
   font-family: monospace; 
   font-size: 80%;
}
dmapr is offline   Reply With Quote
Old Today, 11:26 AM   #7
Anak
Fanatic
Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.
 
Posts: 500
Karma: 483180
Join Date: Mar 2012
Location: DE
Device: Kobo Glo
Quote:
Originally Posted by dmapr View Post
book ignoring ALL CSS, while other books worked fine.
@dmapr. There is nothing wrong with your code.
Are you sure that the original stylesheet is correct?
A minor error (i.e. a missing semicolon ; ) will break the CSS on Kobo ereaders while Sigil displays the output as intended.

CSS Validation Tool: http://jigsaw.w3.org/css-validator/validator
Anak is offline   Reply With Quote
Old Today, 12:25 PM   #8
jackie_w
Wizard
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: 2,841
Karma: 4200035
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"/AuraH2O
Quote:
Originally Posted by dmapr View Post
A somewhat related question. I have tried to use the technique described by jackie_w to add monospace fonts and occasionally it would result in the book ignoring ALL CSS, while other books worked fine. Can anyone spot anything wrong with my kobo_extra.css?
Another thing to try... I've also experienced all css being ignored. Find a book with the problem and have a look at its internal css. Do you see any occurrences of !important in there? If so remove them and try again.
jackie_w is online now   Reply With Quote
Old Today, 02:11 PM   #9
dmapr
Addict
dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.
 
Posts: 261
Karma: 90958
Join Date: Sep 2009
Device: PRS-950, Kobo Aura HD
Quote:
Originally Posted by Anak View Post
@dmapr. There is nothing wrong with your code.
Are you sure that the original stylesheet is correct?
A minor error (i.e. a missing semicolon ; ) will break the CSS on Kobo ereaders while Sigil displays the output as intended.

CSS Validation Tool: http://jigsaw.w3.org/css-validator/validator
I did not spot anything obvious like that while looking at the merged CSS file, and the original CSS works if I don't use the extras. I suppose I should try to run the merged one through the validator if I run into this again, thanks for the link.

Quote:
Originally Posted by jackie_w View Post
Another thing to try... I've also experienced all css being ignored. Find a book with the problem and have a look at its internal css. Do you see any occurrences of !important in there? If so remove them and try again.
Thanks for the tip. Next time I run into this I'll check for that.
dmapr is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to invoke different fonts in CSS 2.3.1? xuyn2003 Kobo Reader 32 01-06-2013 09:52 PM
working with fonts in css jayz Kindle Formats 9 10-29-2012 04:09 PM
PRS-T1 Adding two fonts into the CSS? WarGhSt Sony Reader 1 02-02-2012 01:41 AM
Opus Fonts directory for Calibre -> External CSS fiery Bookeen 12 02-20-2011 10:05 PM
nook fonts via CSS danrodney Barnes & Noble NOOK 1 12-21-2010 07:56 AM


All times are GMT -4. The time now is 02:35 PM.


MobileRead.com is a privately owned, operated and funded community.