09-17-2011, 12:10 PM | #1 |
Junior Member
Posts: 7
Karma: 10
Join Date: Aug 2011
Location: Italy
Device: none
|
The ePub 2.0.1 specifications and font embedding
Hello
I'm having trouble finding where in the ePub specifications they discuss the nuts and bolts of font embedding. I only found a vague treatment of this matter in relation to encryption. At the very least I need to know: 1) whether all I have to do to embed an unencrypted font is include its file in the package (I'm using the "Add file" command in "oXygen XML Author 13"), reference it in the manifest and use "@font-face" in my stylesheet 2) whether OpenType fonts are supported 3) which value for the "media-type" attribute should be used for OpenType fonts. I've been happily using OpenType fonts labeled as "application/vnd.ms-opentype" for my tests in Adobe Digital Editions but I have now to ask questions 2) and 3) because a publisher is complaining about my files being rejected by epubcheck 1.2 with a "hyperlink to non-standard resource" error. I'd be grateful for any links and comments. Thank you very much! Giordano |
09-17-2011, 12:22 PM | #2 |
Member
Posts: 20
Karma: 12
Join Date: Sep 2011
Device: Kindke
|
Here's a link that will help you: http://blog.threepress.org/2009/09/1...in-epub-files/
1- See the link above 2- OpenType is definitely supported, all the EPub standard doc always refer to OpenType font 3- media-type="font/opentype"/ Hope that helps. |
Advert | |
|
09-17-2011, 01:31 PM | #3 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Remember that font embedding seems to be a hit-and-miss for readers. Some readers do honor the specs and use it. Others just plainly ignore it.
|
09-18-2011, 03:43 AM | #4 |
frumious Bandersnatch
Posts: 7,534
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
1. You have to include the font in the package, add a @font-face definition to the CSS and include the reference in the OPF manifest.
2. Actually, OpenType is the only format supported, at least it's the only format suggested by the spec. 3. "application/vnd.ms-opentype", according to the spec. The message "hyperlink to non-standard resource" probably means that somewhere you have a link to something that is not an XHTML file, it could be a link to an image or something like that. That's not allowed. |
09-18-2011, 09:33 AM | #5 |
Member
Posts: 20
Karma: 12
Join Date: Sep 2011
Device: Kindke
|
|
Advert | |
|
09-18-2011, 07:28 PM | #6 |
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
|
It seems that most readers and browsers don't really check the media type. Which is good, because as far as I can find out, only one obsolete font ever got a assigned media type.
Still, for future compatibility, one needs something, and the most common recommendation seems to be media-type=application/x-font-otf (or ttf, depending on the file type). x is for extension, as there is no assigned type for fonts. While vnd.ms-opentype probably is correct, both otf and ttf are recognized standard types, so I don't think we need to use the vendor specific designation, as long as we use x-font-something. But font/anything is incorrect, as IANA doesn't have a font mime-type directory. At least, that's what I'm going to do from now on. |
09-18-2011, 10:11 PM | #7 |
Member
Posts: 20
Karma: 12
Join Date: Sep 2011
Device: Kindke
|
Thanks pholy, it clarify things. Sigil is using application/x-font-ttf for the TrueType fonts. If I understand what you said, it's as good and anything else for now so I won't mess with it.
|
09-19-2011, 04:23 AM | #8 |
frumious Bandersnatch
Posts: 7,534
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
However, the current spec explicitly calls for "application/vnd.ms-opentype", so using something else for opentype is against it.
|
09-24-2011, 10:28 AM | #9 | |
Junior Member
Posts: 7
Karma: 10
Join Date: Aug 2011
Location: Italy
Device: none
|
Quote:
Anyway, I'm delighted at the quality of this discussion, it has significantly added to my understanding of the matter and will be of great help in the future. Thanks to everybody for your interest! |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem embedding font into an ePub | mvo | ePub | 16 | 01-03-2012 07:10 PM |
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 |