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 07-16-2014, 08:34 AM   #1
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,548
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Embedded fonts in epub

With firmware 3.5.0 (I'm not sure about previous versions) I've noticed that custom fonts override some embedded fonts, depending on how they are used.

For instance:

Code:
<div class="font">
<p>Test</p>
</div>

<div>
<p><span class="font">Test</span></p>
</div>
where the class "font" just uses some embedded font with font-family.

With "Document Default" font selected, both "Test" use the embedded font, but if I select any other font (included or sideloaded), only the second one uses the embedded font, and the first uses whichever font I've selected.

So, it looks like the selected font is being used "as if" in a p or * CSS rule. Does anyone have further information on how exactly this works? Could a patch be created to make the custom font apply to body only (I'm interested in chosing my default font, but not overriding document-defined fonts)?
Jellby is offline   Reply With Quote
Old 07-16-2014, 07:10 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: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
Quote:
Originally Posted by Jellby View Post
So, it looks like the selected font is being used "as if" in a p or * CSS rule. Does anyone have further information on how exactly this works? Could a patch be created to make the custom font apply to body only (I'm interested in chosing my default font, but not overriding document-defined fonts)?
If you don't have "Document Default" selected, then the internal epub stylesheet will include this entry:
Code:
body, p { font-family: -ua-default !important; }
where "-ua-default" is the font selected from the device.

This hasn't changed in 3.5.0. It is easy enough to create a patch to alter this entry, provided the length of the replacement line does not exceed the original.
GeoffR is offline   Reply With Quote
Advert
Old 07-16-2014, 07:16 PM   #3
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,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by Jellby View Post
With firmware 3.5.0 (I'm not sure about previous versions) I've noticed that custom fonts override some embedded fonts, depending on how they are used.

For instance:

Code:
<div class="font">
<p>Test</p>
</div>

<div>
<p><span class="font">Test</span></p>
</div>
where the class "font" just uses some embedded font with font-family.

With "Document Default" font selected, both "Test" use the embedded font, but if I select any other font (included or sideloaded), only the second one uses the embedded font, and the first uses whichever font I've selected.

So, it looks like the selected font is being used "as if" in a p or * CSS rule. Does anyone have further information on how exactly this works? Could a patch be created to make the custom font apply to body only (I'm interested in chosing my default font, but not overriding document-defined fonts)?
It has been this way for many fw versions. The Kobo internal css override is something like this
Code:
@font-face { font-family: -ua-default; font-style: normal; font-weight: normal; src: url('res:///fonts/normal/%1') }
@font-face { font-family: -ua-default; font-style: italic; font-weight: normal; src: url('res:///fonts/italic/%1') }
@font-face { font-family: -ua-default; font-style: italic; font-weight: bold; src: url('res:///fonts/bolditalic/%1') }
@font-face { font-family: -ua-default; font-style: normal; font-weight: bold; src: url('res:///fonts/bold/%1') }
body, p { font-family: -ua-default !important; }
body {text-align: %1 !important;
line-height: %1em !important;
padding-bottom: %1em !important;
-kobo-font-sharpness: %1;
-kobo-font-thickness: %1;}
The problem being the red bit, as you suspected. Ironically, I suspect the body, p {...} was introduced by Kobo due to complaints from users because the Kobo override wasn't happening when they wanted it to.

As for a possible fix - you're in luck I also don't like the body, p {} so I've added this simple patch to the end of my libnickel.so.1.0.0.patch config file for fw 3.5.0 only.
Code:
<Patch>
patch_name = `jackie_w Font family override (all devices)`
patch_enable = `yes`
replace_bytes = C3DF10, 2C 00 20 00 70 00, 20 00 20 00 20 00
</Patch>
All it does is change the ', p' to 3 spaces. I've never made it public before because I couldn't face trying to explain to non-css-aficionados why it might be desirable. As you've asked, I have no problem sharing

Last edited by jackie_w; 07-16-2014 at 07:20 PM.
jackie_w is offline   Reply With Quote
Old 07-17-2014, 03:07 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: 7,548
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Thank you, that's exactly what I was looking for
Jellby is offline   Reply With Quote
Old 07-24-2014, 10:59 AM   #5
shalym
Wizard
shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.
 
shalym's Avatar
 
Posts: 3,058
Karma: 54671821
Join Date: Feb 2012
Location: New England
Device: PW 1, 2, 3, Voyage, Oasis 2 & 3, Fires, Aura HD, iPad
Quote:
Originally Posted by jackie_w View Post
It has been this way for many fw versions. The Kobo internal css override is something like this

The problem being the red bit, as you suspected. Ironically, I suspect the body, p {...} was introduced by Kobo due to complaints from users because the Kobo override wasn't happening when they wanted it to.

As for a possible fix - you're in luck I also don't like the body, p {} so I've added this simple patch to the end of my libnickel.so.1.0.0.patch config file for fw 3.5.0 only.

All it does is change the ', p' to 3 spaces. I've never made it public before because I couldn't face trying to explain to non-css-aficionados why it might be desirable. As you've asked, I have no problem sharing
Please please don't create a book for sale using this method--If I buy a book and can't customize the font, I will immediately ask for a refund and refuse to buy anything from that author (or publisher) again until it has been proven to me that they don't do that anymore. One of the perks of e-reading is the ability to change the font to one that is comfortable for the reader.

Shari
shalym is offline   Reply With Quote
Advert
Old 07-24-2014, 11:29 AM   #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,548
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Relax, this has nothing to do with creating books, it's just the internal method the reader uses to let the user configure the font.
Jellby is offline   Reply With Quote
Old 07-24-2014, 02:35 PM   #7
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by shalym View Post
...If I buy a book and can't customize the font, I will immediately ask for a refund and refuse to buy anything from that author (or publisher) again until it has been proven to me that they don't do that anymore.

Shari
you must burn though a lot of refunds and have a huge blacklist then

its probably easier to ask what publishers you have white listed
cybmole is offline   Reply With Quote
Old 07-24-2014, 05:17 PM   #8
shalym
Wizard
shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.
 
shalym's Avatar
 
Posts: 3,058
Karma: 54671821
Join Date: Feb 2012
Location: New England
Device: PW 1, 2, 3, Voyage, Oasis 2 & 3, Fires, Aura HD, iPad
Quote:
Originally Posted by cybmole View Post
you must burn though a lot of refunds and have a huge blacklist then

its probably easier to ask what publishers you have white listed
I've actually only found this 3 or 4 times, all with self published books. I took it up with the authors directly, and they fixed it, and sent me new copies.

Shari
shalym is offline   Reply With Quote
Old 07-25-2014, 01:24 AM   #9
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
ok - embedded is the wrong word here - an awful lot of books have "preferred" fonts e.g. the book CSS says "font-family: times.....;" or even just "font-family:serif: " and either of those will stop the on-device font selector working ( on my Aura HD anyway), even though those fonts are not actually embedded.
cybmole is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fonts not being embedded (epub) soundsfromsound Calibre 19 10-04-2013 01:31 PM
HTML -> EPUB with no embedded fonts doremifaso Calibre 10 09-25-2010 05:56 AM
Embedded fonts in epub erik5000 ePub 7 12-08-2009 11:55 AM
ePub embedded fonts JSWolf Ectaco jetBook 9 09-14-2009 08:43 PM
ePub + Embedded Fonts Cygfrydd ePub 11 03-02-2009 05:56 PM


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


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