![]() |
#1 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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> 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)? |
![]() |
![]() |
![]() |
#2 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
|
Quote:
Code:
body, p { font-family: -ua-default !important; } 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. |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
Quote:
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;}
As for a possible fix - you're in luck ![]() 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> ![]() Last edited by jackie_w; 07-16-2014 at 07:20 PM. |
|
![]() |
![]() |
![]() |
#4 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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
![]() |
![]() |
![]() |
![]() |
#5 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
Shari |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#7 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
Quote:
![]() its probably easier to ask what publishers you have white listed ![]() |
|
![]() |
![]() |
![]() |
#8 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
Shari |
|
![]() |
![]() |
![]() |
#9 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |