![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
Q: media-type for TrueType fonts?
I'm confused by conflicting error messages between Sigil and Calibre Editor and don't know if it makes a difference
![]() Calibre Editor wants <item href="Fonts/Georgia.ttf" id="Georgia.ttf" media-type="application/x-font-truetype" /> and Sigil wants <item href="Fonts/Georgia.ttf" id="Georgia.ttf" media-type="application/x-font-ttf" /> Does it make any difference? Paul |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,337
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
calibre recommends you use the mimetypes specified in the epub 3 specification. I dont know what the basis for Sigil's recommendation is.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
Thanks
BTW -- I really like the context-specific 'Offer to Fix' in Debug. Seems to be safer than the Sigil 'Fix Automatically' Paul |
![]() |
![]() |
![]() |
#4 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 195
Karma: 42216
Join Date: Oct 2013
Location: Poland
Device: Kindles: KOA1, KV
|
|
![]() |
![]() |
![]() |
#5 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,711
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
I use application/x-font-ttf and epubcheck 3.0.1 is happy with it.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,337
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
It used to be here: http://www.idpf.org/epub/30/spec/epu...re-media-types
but it looks like they removed it. Personally, if you ask me, they should be using the IANA registered mimetype of application/font-sfnt http://www.iana.org/assignments/medi...tion/font-sfnt |
![]() |
![]() |
![]() |
#7 | |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 195
Karma: 42216
Join Date: Oct 2013
Location: Poland
Device: Kindles: KOA1, KV
|
Quote:
epubcheck 4 (alpha11) checks font mime type, but it isn't strict. It really looks for "font" string in mime type, so it is happy with such mime types:
But throws warning in this case "application/x-fo1nt-truetype": WARNING(CSS-007): ./github/ttf.epub/OEBPS/Styles/Style0001.css(28,5): Font-face reference OEBPS/Fonts/FiraSans1.otf refers to non-standard font type application/x-fo1nt-truetype. Also it doesn't check extension of font file .otf or .ttf Last edited by quiris; 01-13-2015 at 03:20 AM. |
|
![]() |
![]() |
![]() |
#8 | |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 195
Karma: 42216
Join Date: Oct 2013
Location: Poland
Device: Kindles: KOA1, KV
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#9 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,711
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
![]() |
![]() |
![]() |
#10 | |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 195
Karma: 42216
Join Date: Oct 2013
Location: Poland
Device: Kindles: KOA1, KV
|
Quote:
Code:
java -jar ~/github/epubcheck-4.0.0-alpha11/epubcheck.jar ~/github/ttf_2.epub Validating against EPUB version 2.0 - custom validation Validating using EPUB version 2.0 rules. No errors or warnings detected. epubcheck completed Code:
java -jar ~/github/epubcheck-4.0.0-alpha11/epubcheck.jar ~/github/ttf_3.epub Validating against EPUB version 3.0 - custom validation Validating using EPUB version 3.0 rules. WARNING(CSS-007): ./github/ttf_3.epub/OEBPS/Styles/Style0001.css(3,5): Font-face reference OEBPS/Fonts/DejaVuSans0.ttf refers to non-standard font type application/x-font-ttf. WARNING(CSS-007): ./github/ttf_3.epub/OEBPS/Styles/Style0001.css(8,5): Font-face reference OEBPS/Fonts/DejaVuSans1.ttf refers to non-standard font type application/x-font-truetype. WARNING(CSS-007): ./github/ttf_3.epub/OEBPS/Styles/Style0001.css(18,5): Font-face reference OEBPS/Fonts/DejaVuSans3.ttf refers to non-standard font type application/font-sfnt. WARNING(CSS-007): ./github/ttf_3.epub/OEBPS/Styles/Style0001.css(23,5): Font-face reference OEBPS/Fonts/FiraSans0.otf refers to non-standard font type application/x-font-ttf. WARNING(CSS-007): ./github/ttf_3.epub/OEBPS/Styles/Style0001.css(28,5): Font-face reference OEBPS/Fonts/FiraSans1.otf refers to non-standard font type application/x-font-truetype. WARNING(CSS-007): ./github/ttf_3.epub/OEBPS/Styles/Style0001.css(38,5): Font-face reference OEBPS/Fonts/FiraSans3.otf refers to non-standard font type application/font-sfnt. Check finished with warnings epubcheck completed |
|
![]() |
![]() |
![]() |
#11 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,337
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
As far as I can tell, the EPUB 3 spec only specifies the mimetype for otf files, not ttf files. In fact if you read http://www.idpf.org/epub/301/spec/ep...re-media-types ttf files are apparently not a core media type in epub 3.
So if epubcheck is complaining about any particular mimetype for ttf files being wrong, epubcheck is wrong. As far as I can tell, the spec has absolutely nothing to say about what mimetype should be used for ttf files any more. |
![]() |
![]() |
![]() |
#12 | ||
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 195
Karma: 42216
Join Date: Oct 2013
Location: Poland
Device: Kindles: KOA1, KV
|
Kovid, according EPUB standard application/vnd.ms-opentype applies to OpenType fonts.
OpenType fonts can have *.ttf and *.otf extensions. Check: https://www.iana.org/assignments/med...tion/font-sfnt Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#13 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,337
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Really, you're saying that the EPUB 3.0 spec has changed the mime type for ttf files to something that was never used for them by any software that I have ever heard of, is different from the IANA registered mime type and is different from the most widely used mime-types for ttf in EPUB 2.0?
In that case, all I can say is: Hooray! for the EPUB 3.0 spec. I am not going to change calibre's behavior to follow that particular braindead idea. Fortunately, it doesn't matter, since calibre does not support EPUB 3 in any case. |
![]() |
![]() |
![]() |
#14 | ||
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 195
Karma: 42216
Join Date: Oct 2013
Location: Poland
Device: Kindles: KOA1, KV
|
Quote:
Check also: BTW. EPUB 2.0.1 http://www.idpf.org/epub/20/spec/OPF...m#Section2.3.1 also recommends application/vnd.ms-opentype: Quote:
Last edited by quiris; 01-14-2015 at 03:59 AM. |
||
![]() |
![]() |
![]() |
#15 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,337
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I wish you the best of luck in getting the spec amended. If it is ever amended, do ping me, and I will modify the editor to check if the epub is version 3 and if so, change the recommended mime type for the fonts accordingly.
AS it stands however, I cannot have the recommended type be something that might well break interoperability with existing software, when tht something is so obviously not the right value in any case. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with detection/correction of media-type error | jackie_w | Editor | 2 | 01-04-2014 08:06 AM |
Buy vs licence in another media type | murraypaul | General Discussions | 15 | 06-11-2013 11:11 PM |
MP3 defined in opf as media-type="text/plain | LGN | Sigil | 5 | 04-26-2013 03:38 PM |
media-type | me too | ePub | 5 | 08-07-2012 05:32 PM |
Permissable Spine Media Type Error | mimosawind | ePub | 5 | 10-07-2011 03:55 AM |