Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 12-23-2014, 09:31 AM   #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: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Font families not working

I have code that is supposed to display text in monospace.

Code:
.monospace {
font-family: monospace
}
.para-wlf {
margin-top: 1em;
text-indent: 1em;
margin-left: 0;
margin-right: 0;
margin-bottom: 0;
}
Code:
<p class="para-wlf monospace">This is the paragraph.</p>
The monospace font is overridden and I do not get a monopsace font. Would this work is the p was changed to a div?
JSWolf is offline   Reply With Quote
Old 12-23-2014, 10:41 AM   #2
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: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
I don't think so, but I haven't tried. This was already noticed in the ePub Reader Test:

Default Fonts: Default font is customizable, but standard families do not change. "cursive" and "fantasy" look like "serif", "monospace" looks like the custom default.
Jellby is online now   Reply With Quote
Advert
Old 12-23-2014, 10:45 AM   #3
icallaci
Guru
icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.
 
Posts: 769
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
I don't believe Kobo provides a default monospace font. The solution is discussed here (see post #8): https://www.mobileread.com/forums/sho...kobo_extra.css
icallaci is offline   Reply With Quote
Old 12-23-2014, 11:41 AM   #4
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,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by JSWolf View Post
The monospace font is overridden and I do not get a monopsace font. Would this work is the p was changed to a div?
As long as you've also taken steps (as per icallaci's link re: kobo_extra.css) to point the Kobo at a sideloaded monospace font the answer should be 'yes'. Similarly, this 2nd option should also work:
Code:
<p class="para-wlf"><span class="monospace">This is the paragraph.</span></p>
The root of the problem with the mono class being defined on the <p> tag is that the fw internal css override (userStyle.css) for the Adobe renderer contains this css code
Code:
body, p {font-family: -ua-default !important;}
where you can see that the <p> tag is being forcibly overridden. Consequently, a 3rd option is to use the Patcher to change it to
Code:
body    {font-family: -ua-default !important;}
For me, this is much less effort than changing the html in every epub, but whether it's a good solution for you will depend on how/where you allow font-family code in your epub css. For many people it may make things worse, but I'm happy to post the extra Patch for fw 3.12 if you think it will help.

Last edited by jackie_w; 12-23-2014 at 11:43 AM.
jackie_w is offline   Reply With Quote
Old 12-23-2014, 01:37 PM   #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: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by jackie_w View Post
As long as you've also taken steps (as per icallaci's link re: kobo_extra.css) to point the Kobo at a sideloaded monospace font the answer should be 'yes'. Similarly, this 2nd option should also work:
Code:
<p class="para-wlf"><span class="monospace">This is the paragraph.</span></p>
The root of the problem with the mono class being defined on the <p> tag is that the fw internal css override (userStyle.css) for the Adobe renderer contains this css code
Code:
body, p {font-family: -ua-default !important;}
where you can see that the <p> tag is being forcibly overridden. Consequently, a 3rd option is to use the Patcher to change it to
Code:
body    {font-family: -ua-default !important;}
For me, this is much less effort than changing the html in every epub, but whether it's a good solution for you will depend on how/where you allow font-family code in your epub css. For many people it may make things worse, but I'm happy to post the extra Patch for fw 3.12 if you think it will help.
Please yes, post the patch. I would like to give it a try. Thank you for this.
JSWolf is offline   Reply With Quote
Advert
Old 12-23-2014, 01:49 PM   #6
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,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by JSWolf View Post
Please yes, post the patch. I would like to give it a try. Thank you for this.
Here you are, for fw 3.12.0 only:
Code:
<Patch>
patch_name = `Un-force font-family override p tags (std epubs)`
patch_enable = `yes`
replace_bytes = C99A64, 2C 00 20 00 70 00, 20 00 20 00 20 00
</Patch>
jackie_w is offline   Reply With Quote
Old 12-23-2014, 03:37 PM   #7
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: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by jackie_w View Post
Here you are, for fw 3.12.0 only:
Code:
<Patch>
patch_name = `Un-force font-family override p tags (std epubs)`
patch_enable = `yes`
replace_bytes = C99A64, 2C 00 20 00 70 00, 20 00 20 00 20 00
</Patch>
Thank you. I'll give this a try and see how it goes. I'll report back in this thread.

a div in place of a p did not work.
JSWolf is offline   Reply With Quote
Old 12-23-2014, 03:49 PM   #8
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: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Monospace did not work for some reason. It should have though. ADE for Windows does support monospace as a font name. My T1 and 650 also work with monospace. It's Kobo that is not working.
JSWolf is offline   Reply With Quote
Old 12-23-2014, 04:22 PM   #9
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: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
The book I am trying to fix is The Martian by Andy Weir. The problem is that the embedded fonts are some sort of free serif, freemono, and freesans. They are way too light for eInk and I did replace the main font and that worked fine. The sans-serif font is tolerable but the default sans-serif font is better. The mono font is lousy. It's very light. When using an external light source, I can read it. But using the front light, it's barely readable. Dark Courier is so much better.

I tried monospace with a div and that did not work. I tried the patch that jackie_w posted and that did not work. I'm beginning to think there is no monospace font.
JSWolf is offline   Reply With Quote
Old 12-23-2014, 04:47 PM   #10
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: 598
Karma: 641742
Join Date: Mar 2012
Location: DE
Device: Kobo Glo
In the past Kobo readers had an embedded monospace font on board which was linked to generic font family monopace.
At some point (don't know from which firmware version, i guess 2.x.x) Kobo made a poor decision to link a dyslectic font to the generic font family monospace. And removed the embedded monospace font completely.


Personally, i think that using a dyslectic font for the generic font family monospace is the wrong way to implement this.
It would have been wiser to link a dyslectic font to the generic font families cursive or fantasy. Those two generic font families are currently not used by Kobo at all. And those two generic font families aren't widely used by publishers.

IMO, a good reader needs a proper serif, sans serif and a monospace font.
Anak is offline   Reply With Quote
Old 12-23-2014, 04:58 PM   #11
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,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by JSWolf View Post
The book I am trying to fix is The Martian by Andy Weir. The problem is that the embedded fonts are some sort of free serif, freemono, and freesans. They are way too light for eInk and I did replace the main font and that worked fine. The sans-serif font is tolerable but the default sans-serif font is better. The mono font is lousy. It's very light. When using an external light source, I can read it. But using the front light, it's barely readable. Dark Courier is so much better.

I tried monospace with a div and that did not work. I tried the patch that jackie_w posted and that did not work. I'm beginning to think there is no monospace font.
No, perhaps you misunderstood what icallaci said - Kobo has no built-in monospace font (surprising, I know). You need to
- sideload a monospace font (like Dark Courier) and
- do the kobo_extra.css trick from the post #3 link and
- at least one of the other 3 options (<div>, <span> or my special Patch).

The kobo_extra.css will then add the monospace @font-faces to every epub you subsequently send-to-device with calibre. Most epubs won't need or use it but those that contain instances of font-family:monospace should use it correctly.
jackie_w is offline   Reply With Quote
Old 12-23-2014, 05:20 PM   #12
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: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by jackie_w View Post
No, perhaps you misunderstood what icallaci said - Kobo has no built-in monospace font (surprising, I know). You need to
- sideload a monospace font (like Dark Courier) and
- do the kobo_extra.css trick from the post #3 link and
- at least one of the other 3 options (<div>, <span> or my special Patch).

The kobo_extra.css will then add the monospace @font-faces to every epub you subsequently send-to-device with calibre. Most epubs won't need or use it but those that contain instances of font-family:monospace should use it correctly.
If you don't have the patch you posted, you'll need to set for document default. Question: what font is the font used with document default if there is no embedded font? In the eBook I am reading, monospace is used to differentiate things and it works well. But without it, it loses that and that's not a good thing.
JSWolf is offline   Reply With Quote
Old 12-23-2014, 05:30 PM   #13
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,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by JSWolf View Post
Question: what font is the font used with document default if there is no embedded font?
Georgia, I think.

Just to be clear, is the Patch option working for you now?

ETA: I never use Document Default. If I want Charis (or anything else) I prefer to select it from the menu. Also coding font-family:serif always seems to give you Georgia on Kobos so it's best to remove all occurrences if this would be unwelcome.

Last edited by jackie_w; 12-23-2014 at 06:05 PM.
jackie_w is offline   Reply With Quote
Old 12-23-2014, 06:45 PM   #14
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: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by jackie_w View Post
Georgia, I think.

Just to be clear, is the Patch option working for you now?

ETA: I never use Document Default. If I want Charis (or anything else) I prefer to select it from the menu. Also coding font-family:serif always seems to give you Georgia on Kobos so it's best to remove all occurrences if this would be unwelcome.
I remove all occurrences of font-family: serif. I also remove any line-height and justify: left. I'll have to embed Dark Courier if there is monospace used. I'll see if I need to use document default now that I've applied the patch you've posted.
JSWolf is offline   Reply With Quote
Old 12-23-2014, 07:01 PM   #15
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,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by JSWolf View Post
I'll have to embed Dark Courier if there is monospace used.
You can do this if you want, but why is it necessary? I've never needed to embed any fonts (monospace, small-caps, fancy initials etc.) to access them.

Last edited by jackie_w; 12-23-2014 at 07:03 PM.
jackie_w is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fonts and font families troll05 General Discussions 3 05-06-2013 07:53 PM
Font-families and justified alignment ElMiko Sigil 46 03-04-2013 02:27 AM
More on working around the font-size issue billingd Kobo Reader 13 06-25-2010 08:49 PM
Multiple Font Families in one Ebook (K2) delphidb96 Amazon Kindle 1 12-13-2009 11:11 PM
505 vs. different font families in LRF pepak Sony Reader 8 09-29-2009 01:03 PM


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


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