03-10-2015, 11:34 AM | #1 |
Enthusiast
Posts: 28
Karma: 10
Join Date: Oct 2012
Device: Kobo Elipsa E2, Kobo Aura H20 ed 2, Kobo Clara, Sony PRS T2 & T3
|
Original file font + E-reader native fonts - not possible?
Hi,
Could anyone help me with this one, please: Whenever an e-book I read came with its own embedded fonts, I like to keep those, to keep the ebook close to the original print version. Most of the time these are serif-type fonts. However, when the light is poor and/or my eyes are tired, I would like to be able to shift to a thicker font, such as "Frutiger Neue" on my Sonys (T2 and T3). Most of the time just shifting from the original thin serif font to a thicker sans-serif does the job, without necessarily having to increase font size. However, when I try to modify the *.CSS file, by adding either the generic sans-serif or the more specific "Frutiger Neue", my Sony would still stick to the original font, refusing to shift to the sans-serif font. What am I doing wrong? Is there some recommended order of these fonts? Some writing convention that I ignore? Here's an example of the change I made: Original: font-family: "GenBas"; My change: font-family: "GenBas", "Frutiger Neue", sans-serif; In brief: I would like GenBas to be visible as Default (Original font) as well as some sans-serif, as Frutiger Neue (ont native to Sony). The alterations in the CSS don't seem to work. Thanks! |
03-10-2015, 02:00 PM | #2 |
Well trained by Cats
Posts: 29,793
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Those are Fallback fonts, not alternate (use) fonts
font-family: "GenBas", "Frutiger Neue", sans-serif; If the book can not find GenBas (?? is this a non-standard name for Gentium Basic ??) It will try Frutiger Neue And if it cant find either of thos, use the systems default sans-serif |
03-10-2015, 02:51 PM | #3 |
Resident Curmudgeon
Posts: 73,947
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
I know the solution to your problem.
Use font-family: sans-serif; instead of font-family: "GenBas"; in the font family definition and anyplace the font is called. Then you can switch fonts. when you want. If for some reason that doesn't work, try serif instead of sans-serif. But try it as above first. |
03-11-2015, 07:04 AM | #4 |
Enthusiast
Posts: 28
Karma: 10
Join Date: Oct 2012
Device: Kobo Elipsa E2, Kobo Aura H20 ed 2, Kobo Clara, Sony PRS T2 & T3
|
@The Ducks
Yes, I can see this... fallback fonts. Problem is that if the ereder finds GenBas (and yes, that is Gentium Basic indeed), it is happy with that and will not go any further; that is, I cannot switch it to Universe or Frutiger Neue. @JSWolf Thanks for the tip. I edited the font definition in page_style.css and then the occurrences of that font in the stylesheet.css proper, tricking the ereader to believe that sans-serif is GenBas. BUT, like above, when I open the file, I'm stuck with GenBas only (which btw is a serif font, but I don't think this matters). I will try your second approach - with serif-- but I'm skeptical... Second edit: Nope. Not working either... Last edited by Jasmine GreenTea; 03-11-2015 at 07:13 AM. |
03-11-2015, 07:33 AM | #5 |
Enthusiast
Posts: 28
Karma: 10
Join Date: Oct 2012
Device: Kobo Elipsa E2, Kobo Aura H20 ed 2, Kobo Clara, Sony PRS T2 & T3
|
Alternatives and their result (I've changed the definition to Gentium):
1. .calibre { display: block; font-family: sans-serif, "Gentium"; Result: Default font is some sans-serif font (Univers); Unsurprisingly, the reader's other sans-serif fonts are available. Surprisingly, all the serif fonts are too! No Gentium. 2. .calibre { display: block; font-family: "Gentium", sans-serif; Result: Default font = Gentium Trying to change to Frutiger / univers ==> I still get Gentium So, unable to change to any other font... 3. .calibre { display: block; font-family: "Gentium", "Frutiger Neue", "Univers Next", "Palatino nova"; Result: Default font : Gentium Trying to change to Frutiger, Univers or Palatino ==> I still get Gentium! Well, I'm stuck! Either I can have all the reader's system fonts but no Gentium, OR I have Gentium and no other font! And what I need is BOTH! Is there any way I can indicate ALTERNATIVE fonts rather than FALLBACK fonts? |
03-11-2015, 12:03 PM | #6 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
You can't do that with a single CSS rule. You need some way to enable/disable CSS rules, so you can choose between the embedded font (font-family:"Gentium") to whatever you you chose in your reader (no font-family specified). There is at least one standard compliant way to do this: alternate stylesheets, but I'm not aware of any reader that supports this.
In some readers you may have the option to ignore all ebook styles and use only your own, or to specify some stylesheet to override the ones in the book (in that case you could use "font-family:serif !important", and cross your fingers). |
03-11-2015, 06:17 PM | #7 | |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
In the epub css sheet, change Code:
.calibre { display: block; font-family: "Gentium";} Code:
body {
display: block;
font-family: "Gentium";}
Then, when you set the Sony's font menu to Default (Original) you should see Gentium, but if you choose one of the built-in sans-serif fonts (such as Frutiger) you should see that instead. Just FYI, as far as I remember, hard-coding the Sony built-in font names in the epub css file will have no effect at all on a Sony, that's not how font-changing works. ETA: If that doesn't work, post the @font-face statements you're using in this epub. Last edited by jackie_w; 03-11-2015 at 06:22 PM. |
|
03-11-2015, 06:31 PM | #8 | |
Well trained by Cats
Posts: 29,793
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
<body class='calibre'> (original) should be the same a <body> (your way) |
|
03-11-2015, 06:35 PM | #9 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Some devices have the ability to override font-family at body level only but not lower down (e.g. body.calibre or .calibre). I just can't remember whether the Sonys are like this or not.
|
03-11-2015, 06:48 PM | #10 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
@Jasmine GreenTea,
If Plan A in post #7 doesn't work Plan B would be to change all 4 epub @font-faces from: Code:
@font-face {font-family: "Gentium"; ... ... } Code:
@font-face {font-family: serif; ... ...}
Code:
.calibre { display: block; font-family: "Gentium";} Code:
.calibre {
display: block;
font-family: serif;}
|
03-12-2015, 07:46 PM | #11 |
Well trained by Cats
Posts: 29,793
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
Tags |
css, fonts, original fonts, sony t2, sony t3 |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to invoke native reader from file browser? | fllc | Kindle Developer's Corner | 1 | 02-01-2015 06:35 PM |
Vivaldi font showing on calibre file preview, but not on Adobe Reader (Newbie Alert) | lina.w | Conversion | 2 | 01-19-2015 05:31 PM |
Flash original Amazon firmware to a Kindle (in native Linux, without Kubrick) | Synthead | Kindle Developer's Corner | 5 | 07-15-2013 02:45 PM |
Native file search | silver18 | Kindle Developer's Corner | 0 | 02-19-2012 06:06 PM |
Fonts with iq original reader | musicman2523 | PocketBook | 0 | 10-24-2011 04:49 PM |