![]() |
#1 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78
Karma: 1588
Join Date: Jan 2011
Location: New Zealand
Device: see signature
|
Problem embedding font into an ePub
Hi all
I would like to embed a particular font (Old Standard from http://www.thessalonica.org.ru/en/oldstandard.html) in a book. In Sigil, Calibre, and the EPub reader add-on to Firefox, all looks fine. (Well, in Sigil and Calibre the italics don't display, but that is ok.) But in ADE, (and on my Sony Reader) the font does not show at all. I have tried the .ttf and .otf versions of the fonts, and checked and double-checked my code in the stylesheet - see below. The font looks fine in Word and other applications, and I can successfully embed other fonts into the ePub. Any suggestions? Do some fonts have characteristics that make them unsuitable for embedding? Any help much appreciated ![]() Code:
@font-face { font-family: "OldStandard"; font-weight: normal; font-style: normal; src: url(../Fonts/OldStandard-Regular.ttf); } @font-face { font-family: "OldStandard"; font-weight: normal; font-style: italic; src: url(../Fonts/OldStandard-Italic.ttf); } body { display: block; margin-top: 0em; margin-bottom: 0em; margin-left: 0em; margin-right: 0em; font-family: "OldStandard", serif; font-size: .90em; text-align: justify; widows: 1; orphans: 1; } |
![]() |
![]() |
![]() |
#2 |
Booklegger
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,801
Karma: 7999816
Join Date: Jun 2009
Location: Toronto, Ontario, Canada
Device: BeBook(1 & 2010), PEZ, PRS-505, Kobo BT, PRS-T1, Playbook, Kobo Touch
|
In the Kobo (using ADE) a font-family in a body selector gets overridden by the reader software; I wasn't aware of this on the Sony. Try putting the font-family in a p selector, to see if it works there.
OTOH, I seem to recall that if ADE detects any errors in the css file, the entire file gets ignored. I can't think of any css verifiers off-hand, unfortunately. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,986
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#4 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,986
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
MVO, the only way to check where the problem may be is for you to post a sample ePub so someone can take a look. The posted code looks OK. But we'd need to see an ePub to help.
|
![]() |
![]() |
![]() |
#5 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78
Karma: 1588
Join Date: Jan 2011
Location: New Zealand
Device: see signature
|
Hi all,
Sample attached. BTW, I am using ADE 1.7.2.1131 Thanks again! |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Quote:
Dale |
|
![]() |
![]() |
![]() |
#7 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 128
Karma: 238654
Join Date: Aug 2009
Device: Kobo Mini (4GB), Nook Classic wi-fi, iPod Touch (Bluefire Reader)
|
I did a little testing, your fonts show up in ADE 1.8 preview, but not in 1.7.2. I renamed a couple of fonts to the same as in the epub and swapped them in and they work fine. Could it be that the file size of the fonts are too large for ADE (both over 600k each)?
[edit] Yeah, definitely looks like something with the fonts not the css, the css file is loading (if there was something broken ADE wouldn't load any formating at all). It's loading the fall-back font and not the embedded ones. Last edited by Keroberos; 09-01-2011 at 01:58 AM. |
![]() |
![]() |
![]() |
#8 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78
Karma: 1588
Join Date: Jan 2011
Location: New Zealand
Device: see signature
|
I hadn't noticed the size of the true type fonts - they are large! The otf versions are smaller, but still don't show. My css seems to validate, just font errors, which I'd expect...
Odd that the fonts show in ADE 1.8 preview, I hadn't tried that. Last edited by mvo; 09-01-2011 at 05:02 AM. Reason: edited to correct dodgy grammar |
![]() |
![]() |
![]() |
#9 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
I suspect the file size might be a problem in some cases, but 600KB doesn't look like too much. If the body override is the problem, you could try with a more specific selector, such as "html body" or "body.text" (and use <body class="text">).
|
![]() |
![]() |
![]() |
#10 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 128
Karma: 238654
Join Date: Aug 2009
Device: Kobo Mini (4GB), Nook Classic wi-fi, iPod Touch (Bluefire Reader)
|
I did some more testing, and it's starting to look like there is something about that font that the ADE 1.7.2 rendering engine does not like. I created a new epub with that font and limited css and it still exhibits the same problem. I also went to font Squirrel and made a limited glyph version of that font and tried that, but it still doesn't load in ADE 1.7.2.
[edit] I also loaded the epub onto my nook and it doesn't load the font, so it's looking like a problem with ADE and that font. That's about the limit of things I could think of to try, anyone else have any ideas? Last edited by Keroberos; 09-01-2011 at 09:50 AM. |
![]() |
![]() |
![]() |
#11 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 128
Karma: 238654
Join Date: Aug 2009
Device: Kobo Mini (4GB), Nook Classic wi-fi, iPod Touch (Bluefire Reader)
|
Good News
I rebuilt the fonts in Font Forge and saved them as otf and now they display in ADE 1.7.2. I've included a zip file with the rebuilt fonts for you to test.
|
![]() |
![]() |
![]() |
#12 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,986
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
My guess is the font size may be the issue with 1.7.2 ADE.
But as has been said before, ADE 1.8 preview the original fonts work fine. |
![]() |
![]() |
![]() |
#13 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78
Karma: 1588
Join Date: Jan 2011
Location: New Zealand
Device: see signature
|
Keroberos, that has done the trick! The rebuilt font shows in ADE and my Sony reader. Thank you very, very much.
I am amazed at the wealth of expertise on this site, and very grateful it is so graciously shared. ![]() |
![]() |
![]() |
![]() |
#14 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 128
Karma: 238654
Join Date: Aug 2009
Device: Kobo Mini (4GB), Nook Classic wi-fi, iPod Touch (Bluefire Reader)
|
You're quite welcome, I've never seen a problem with embedded fonts like that before. I enjoyed trying to figure it out and learned some new things in the process.
|
![]() |
![]() |
![]() |
#15 |
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Jan 2012
Device: Nook Simple Touch
|
I hate reviving all-but-dead threads, but since this is pretty much the only discussion about this issue, I figured I would mention that I am having identical trouble with two other fonts (Linux Libertine and Symbola). Although the Bold, Italic, and Bold Italic versions of Libertine will display correctly in ADE, the Normal version of Libertine fails to load and ADE instead falls back on the Bold version, so that all of the text set in Libertine is in Bold rather than Normal type. Similarly, Symbola fails to load and display any characters it supports.
As the above posters found with respect to Old Standard, I have tried (in FontForge) subsetting the fonts (as the Libertine fonts are over 400K and Symbola is 1.6MB), converting Symbola to OpenType (as it originally comes in TrueType), and re-generating the OpenType font from the original SFDs of Libertine, but this was all to no avail, and the fonts still fail to load. Given the above discussion, Keroberos seems to have found the fix to this issue, but unfortunately it's not clear what needs to be done to make these fonts work. I've attached another example epub file which exhibits these problems (i.e. Libertine Regular not displaying, and ADE falling back on Libertine Bold, as well as Symbola not displaying the symbol characters) using the subset OpenType versions of Symbola (which includes two non-Latin-1 Unicode symbols which are used in the epub) and Libertine which I generated with FontForge. It's possible that the second of the symbol characters (U+1F603) won't display in ADE at all (depending on whether or not ADE correctly supports characters outside of the Basic Multilingual Plane that were introduced in Unicode 6.0), but I would expect at least the first (U+263A) to show up normally if Symbola worked correctly. The subset of Libertine used in the epub has no non-Latin-1 characters at all, and would be unaffected by any issues with high-Unicode support. Knowing the trick to fixing these fonts would be very useful, in case I (or others) run into similar issues with other fonts (and also because I intend to apply some custom kerning tweaks to Libertine that I haven't yet done). Last edited by Pipian; 01-02-2012 at 05:33 AM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Do I need a font license if all I'm doing is referring to the font (not embedding)? | Stodder | Workshop | 21 | 04-21-2011 04:19 AM |
Embedding .symbol font? | Kivgaen | Sigil | 23 | 06-24-2010 09:13 PM |
Another font embedding problem | b.tarde | EPUBReader | 12 | 03-11-2010 01:40 PM |
Automatic font embedding - or something else? | pepak | Calibre | 4 | 06-01-2009 03:38 PM |
Font embedding error | Peto | Calibre | 2 | 08-05-2008 10:40 AM |