Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 03-10-2015, 11:34 AM   #1
Jasmine GreenTea
Enthusiast
Jasmine GreenTea began at the beginning.
 
Jasmine GreenTea's Avatar
 
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!
Jasmine GreenTea is offline   Reply With Quote
Old 03-10-2015, 02:00 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,791
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
theducks is offline   Reply With Quote
Advert
Old 03-10-2015, 02:51 PM   #3
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: 73,931
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.
JSWolf is offline   Reply With Quote
Old 03-11-2015, 07:04 AM   #4
Jasmine GreenTea
Enthusiast
Jasmine GreenTea began at the beginning.
 
Jasmine GreenTea's Avatar
 
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.
Jasmine GreenTea is offline   Reply With Quote
Old 03-11-2015, 07:33 AM   #5
Jasmine GreenTea
Enthusiast
Jasmine GreenTea began at the beginning.
 
Jasmine GreenTea's Avatar
 
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?
Jasmine GreenTea is offline   Reply With Quote
Advert
Old 03-11-2015, 12:03 PM   #6
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
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).
Jellby is offline   Reply With Quote
Old 03-11-2015, 06:17 PM   #7
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 Jasmine GreenTea View Post
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!
I don't have my Sony T1 anymore to test it but I think this may work...

In the epub css sheet, change
Code:
.calibre {
display: block;
font-family: "Gentium";}
to
Code:
body {
display: block;
font-family: "Gentium";}
and make sure there are no other font-family settings anywhere else in the css.

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.
jackie_w is offline   Reply With Quote
Old 03-11-2015, 06:31 PM   #8
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,791
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:
Originally Posted by jackie_w View Post
I don't have my Sony T1 anymore to test it but I think this may work...

In the epub css sheet, change
Code:
.calibre {
display: block;
font-family: "Gentium";}
to
Code:
body {
display: block;
font-family: "Gentium";}
and make sure there are no other font-family settings anywhere else in the css.

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.
it should not matter


<body class='calibre'> (original) should be the same a <body> (your way)
theducks is offline   Reply With Quote
Old 03-11-2015, 06:35 PM   #9
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 theducks View Post
it should not matter


<body class='calibre'> (original) should be the same a <body> (your way)
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.
jackie_w is offline   Reply With Quote
Old 03-11-2015, 06:48 PM   #10
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
@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"; ... ... }
to:
Code:
@font-face {font-family: serif; ... ...}
and change the epub css from:
Code:
.calibre {
display: block;
font-family: "Gentium";}
to
Code:
.calibre {
display: block;
font-family: serif;}
Default(Original) should show Gentium whereas choosing any Sony built-in (serif or sans-serif) should display in that font instead.
jackie_w is offline   Reply With Quote
Old 03-12-2015, 07:46 PM   #11
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,791
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:
Originally Posted by jackie_w View Post
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.
That make sense
theducks is offline   Reply With Quote
Reply

Tags
css, fonts, original fonts, sony t2, sony t3


Forum Jump

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


All times are GMT -4. The time now is 04:31 AM.


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