![]() |
#1 | |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 71
Karma: 18140
Join Date: Jul 2011
Device: PRS-T1&KOBOTOUCH
|
How to invoke different fonts in CSS 2.3.1?
Dear all,
After updated glo to 2.3.1, some thing went wrong. for example CSS: Quote:
Is anybody know how to fix the url? Thanks! |
|
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
I didn't know you could do that. The path used when referring to the books includes "mnt/onboard/". I would try:
res:///mnt/onboard/fonts/ht.ttf |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 71
Karma: 18140
Join Date: Jul 2011
Device: PRS-T1&KOBOTOUCH
|
Thank you Davidfor, I will have a try through this directory.
|
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,243
Karma: 16537488
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
I got quite hopeful for a moment when I read xuyn2003's OP.
I have been successfully using variations on this theme for several years on my Sonys and PocketBook. When I first got the Kobo Glo I tried every 'magic path' I could think of to access external fonts in /fonts to display monospace and small-caps fonts for the few of my epubs which need them. (BTW the Kobo is the first reader I've owned which doesn't contain a monospace font. It must be difficult to read programming manuals without one.) I'm pretty sure I tried both res:///mnt/onboard/fonts/xxx.ttf and res:///fonts/xxx.ttf but had no success whatsoever on fw2.1.5. In the end, the only way I could successfully use the special fonts was by embedding them in the epub when necessary. I've just retested with res:///fonts/xxx.ttf, but still no joy. Given the problems I'm reading about fw 2.3.1 I've decided to stick with fw 2.1.5 for the time being, but if this unofficial v2.2 really works I'd be quite tempted to try it. Has anyone else had success accessing the Kobo font directory from within an epub's css file? |
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,454
Karma: 5469320
Join Date: Jul 2010
Device: Kobo
|
Any particular reason you're trying to do it this way rather than just dump the font on the Kobo and picking it as the desired font when you open the book the 1st first time? It should maintain the font setting for each book, so you only need to change font once.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
|
Quote:
Code:
body {font-family:"Arial Unicode MS"} .sa {font-size: 130%; font-family:"Sanskrit 2003"} Edit: I am on 2.1.5 Last edited by tshering; 12-22-2012 at 05:57 PM. |
|
![]() |
![]() |
![]() |
#7 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,243
Karma: 16537488
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
Quote:
For example, I do not want computer code snippets rendered in the book's main serif font. Neither do I want the same book's main body text rendered in a special monospace font. I want a serif font for the main book and a monospace font for the code snippets. If I wanted to read a book which is a screenplay -- usually rendered completely in monospace -- it wouldn't be a problem to load and select a monospace font from the font list for the whole book. I have a similar problem with some of my own created epubs which need some portions only in a small-caps font. I was quite happy to create them this way because rendering small-caps was not a problem on any of my previous readers -- mainly because of MR community hacking offerings it has to be said. I do not know of any ereader which can support font-variant: small-caps as standard. |
|
![]() |
![]() |
![]() |
#8 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,243
Karma: 16537488
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#9 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,454
Karma: 5469320
Join Date: Jul 2010
Device: Kobo
|
That makes total sense. It would be a pain to not have those rendered monospace.
|
![]() |
![]() |
![]() |
#10 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 71
Karma: 18140
Join Date: Jul 2011
Device: PRS-T1&KOBOTOUCH
|
|
![]() |
![]() |
![]() |
#11 | |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 71
Karma: 18140
Join Date: Jul 2011
Device: PRS-T1&KOBOTOUCH
|
Quote:
So grateful. |
|
![]() |
![]() |
![]() |
#12 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 69
Karma: 1134558
Join Date: Dec 2012
Location: Italy
Device: Cybook Opus, Onyx-Boox Poke5
|
I put this in my epubs:
Code:
font-face { font-family: "Name of the Font"; font-weight: normal; font-style: normal; src: url(../Fonts/name_of_the_font.ttf); } This manner sigil would validate your epub and you'll be sure that you can read it correctly in every ereader you want. HTH HP |
![]() |
![]() |
![]() |
#13 | |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 71
Karma: 18140
Join Date: Jul 2011
Device: PRS-T1&KOBOTOUCH
|
Quote:
I was sucessful in 2.2 but failed in 2.3 firmware. |
|
![]() |
![]() |
![]() |
#14 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,243
Karma: 16537488
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
@xuyn2003 & hubertphava,
I can get any font I want to display as long as I embed it inside the epub, which (if I'm not mistaken) is the method hubertphava is describing. I've had no success at all typing something in the epub css file in an attempt to directly reference a font stored in the Kobo /fonts directory. I've tried both xuyn2003's and tshering's suggestions and neither work for me with fw 2.1.5. In case anyone is interested I'll share a few other things that I found out.
An accidental outcome is that for those people who would like to read with sans-serif font Avenir but don't because all italics are displayed instead as bold... If you add font-family: sans-serif; to your body css you should get the whole book displayed in Avenir with all italics, bold and bolditalics displayed correctly. If you look at line 3 in the attached image you can see this for yourself. |
![]() |
![]() |
![]() |
#15 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
|
Quote:
I wondered what happens if I select a font from the font menu. If the whole text is displayed in the selected font how can I go back to the original settings? When I select Amasis, Avenir and so on the whole text is displayed in the selected font, only if I select Sanskrit 2003 the css settings become active again. |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
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 |
Motivation - can you invoke it? | mukoan | Writers' Corner | 26 | 12-26-2010 07:57 AM |
nook fonts via CSS | danrodney | Barnes & Noble NOOK | 1 | 12-21-2010 07:56 AM |