Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 08-31-2011, 05:36 PM   #1
mvo
Connoisseur
mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.
 
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;
}
Attached Thumbnails
Click image for larger version

Name:	Fonts_image.JPG
Views:	346
Size:	11.1 KB
ID:	75940  
mvo is offline   Reply With Quote
Old 08-31-2011, 09:46 PM   #2
pholy
Booklegger
pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.
 
pholy's Avatar
 
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.
pholy is offline   Reply With Quote
Advert
Old 08-31-2011, 09:50 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,835
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by pholy View Post
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.
That's a bug in Kobo's implementation of ADE. Most ePub from publishers put the font family selector into the body. This does work fine with Sony Readers.
JSWolf is offline   Reply With Quote
Old 08-31-2011, 09:52 PM   #4
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,835
Karma: 128597114
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.
JSWolf is offline   Reply With Quote
Old 08-31-2011, 11:38 PM   #5
mvo
Connoisseur
mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.
 
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!
Attached Files
File Type: epub sample_for_testing_fonts.epub (547.3 KB, 371 views)
mvo is offline   Reply With Quote
Advert
Old 09-01-2011, 01:04 AM   #6
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
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:
Originally Posted by pholy View Post
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.
Here is a CSS Validator: http://jigsaw.w3.org/css-validator/

Dale
DaleDe is offline   Reply With Quote
Old 09-01-2011, 01:46 AM   #7
Keroberos
Zealot
Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.
 
Keroberos's Avatar
 
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.
Keroberos is offline   Reply With Quote
Old 09-01-2011, 04:05 AM   #8
mvo
Connoisseur
mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.
 
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
mvo is offline   Reply With Quote
Old 09-01-2011, 04:23 AM   #9
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,515
Karma: 18512745
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">).
Jellby is offline   Reply With Quote
Old 09-01-2011, 09:47 AM   #10
Keroberos
Zealot
Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.
 
Keroberos's Avatar
 
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.
Keroberos is offline   Reply With Quote
Old 09-01-2011, 10:37 AM   #11
Keroberos
Zealot
Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.
 
Keroberos's Avatar
 
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.
Attached Files
File Type: zip oldstandard-2.2.zip (245.5 KB, 263 views)
Keroberos is offline   Reply With Quote
Old 09-01-2011, 10:48 AM   #12
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,835
Karma: 128597114
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.
JSWolf is offline   Reply With Quote
Old 09-01-2011, 08:07 PM   #13
mvo
Connoisseur
mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.mvo once ate a cherry pie in a record 7 seconds.
 
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.
mvo is offline   Reply With Quote
Old 09-01-2011, 11:09 PM   #14
Keroberos
Zealot
Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.Keroberos ought to be getting tired of karma fortunes by now.
 
Keroberos's Avatar
 
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.
Keroberos is offline   Reply With Quote
Old 01-02-2012, 05:31 AM   #15
Pipian
Junior Member
Pipian began at the beginning.
 
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).
Attached Files
File Type: epub Subsetted.epub (132.1 KB, 294 views)

Last edited by Pipian; 01-02-2012 at 05:33 AM.
Pipian is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 01:14 AM.


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