Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 01-12-2014, 07:16 PM   #1
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,075
Karma: 412718
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
phossler is offline   Reply With Quote
Old 01-12-2014, 09:58 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,866
Karma: 22666666
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.
kovidgoyal is offline   Reply With Quote
Advert
Old 01-13-2014, 01:17 PM   #3
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,075
Karma: 412718
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
phossler is offline   Reply With Quote
Old 01-12-2015, 03:15 PM   #4
quiris
Groupie
quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'
 
quiris's Avatar
 
Posts: 195
Karma: 42216
Join Date: Oct 2013
Location: Poland
Device: Kindles: KOA1, KV
Quote:
Originally Posted by kovidgoyal View Post
calibre recommends you use the mimetypes specified in the epub 3 specification.
Kovid, where did you find "application/x-font-truetype" mimetype for TTF font files in EPUB 3.0 spec? I am unable to find it.
quiris is offline   Reply With Quote
Old 01-12-2015, 04:02 PM   #5
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: 74,035
Karma: 129333114
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.
JSWolf is online now   Reply With Quote
Advert
Old 01-12-2015, 10:17 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,866
Karma: 22666666
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
kovidgoyal is offline   Reply With Quote
Old 01-13-2015, 03:13 AM   #7
quiris
Groupie
quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'
 
quiris's Avatar
 
Posts: 195
Karma: 42216
Join Date: Oct 2013
Location: Poland
Device: Kindles: KOA1, KV
Quote:
Originally Posted by JSWolf View Post
I use application/x-font-ttf and epubcheck 3.0.1 is happy with it.
epubcheck 3.0.1 doesn't validate font mime type.

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:
  • application/x-font-ttf
  • application/x-font-truetype
  • application/font-sfnt
  • font/ttf

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
Attached Files
File Type: epub ttf.epub (1.73 MB, 334 views)

Last edited by quiris; 01-13-2015 at 03:20 AM.
quiris is offline   Reply With Quote
Old 01-13-2015, 03:22 AM   #8
quiris
Groupie
quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'
 
quiris's Avatar
 
Posts: 195
Karma: 42216
Join Date: Oct 2013
Location: Poland
Device: Kindles: KOA1, KV
Quote:
Originally Posted by kovidgoyal View Post
So, it looks like the only allowed mime type (according standard) for .ttf and .otf files is now: application/vnd.ms-opentype
quiris is offline   Reply With Quote
Old 01-13-2015, 04:46 PM   #9
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: 74,035
Karma: 129333114
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 quiris View Post
So, it looks like the only allowed mime type (according standard) for .ttf and .otf files is now: application/vnd.ms-opentype
I'm sticking with application/x-font-ttf for truetype fonts as it works.
JSWolf is online now   Reply With Quote
Old 01-14-2015, 02:53 AM   #10
quiris
Groupie
quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'
 
quiris's Avatar
 
Posts: 195
Karma: 42216
Join Date: Oct 2013
Location: Poland
Device: Kindles: KOA1, KV
Quote:
Originally Posted by quiris View Post
epubcheck 4 (alpha11) checks font mime type, but it isn't strict.
Update. Epubcheck 4.0 isn't strict for EPUB 2.0 version files:

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
Epubcheck 4.0 is strict for EPUB 3.0 version files:

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
Attached Files
File Type: epub ttf_2.epub (1.73 MB, 331 views)
File Type: epub ttf_3.epub (1.74 MB, 306 views)
quiris is offline   Reply With Quote
Old 01-14-2015, 03:11 AM   #11
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,866
Karma: 22666666
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.
kovidgoyal is offline   Reply With Quote
Old 01-14-2015, 03:38 AM   #12
quiris
Groupie
quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'
 
quiris's Avatar
 
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:
File extension(s):
Font file extensions used for OFF / OpenType fonts: .ttf, .otf
Typically, .ttf extension is only used for fonts containing TrueType
outlines, while .otf extension can be used for any OpenType/OFF font,
either with TrueType or CFF outlilnes.
And also: http://www.microsoft.com/typography/otspec/otff.htm

Quote:
OpenType fonts may have the extension .OTF or .TTF, depending on the kind of outlines in the font and the creator's desire for compatibility on systems without native OpenType support.
quiris is offline   Reply With Quote
Old 01-14-2015, 03:47 AM   #13
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,866
Karma: 22666666
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.
kovidgoyal is offline   Reply With Quote
Old 01-14-2015, 03:53 AM   #14
quiris
Groupie
quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'quiris understands when you whisper 'The dog barks at midnight.'
 
quiris's Avatar
 
Posts: 195
Karma: 42216
Join Date: Oct 2013
Location: Poland
Device: Kindles: KOA1, KV
Quote:
Originally Posted by kovidgoyal View Post
In that case, all I can say is: Hooray! for the EPUB 3.0 spec.
I'm also disappointed. But it's true.
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:
Following from #4, above, for the purpose of fallback specification, a file with the media type application/vnd.ms-opentype that specifies an embedded OpenType font should be considered a Core Media Type, thus fallback information must not be provided for this file. The media type application/vnd.ms-opentype should be specified as the media-type value in the item of the manifest that references an OpenType font.

Last edited by quiris; 01-14-2015 at 03:59 AM.
quiris is offline   Reply With Quote
Old 01-14-2015, 03:58 AM   #15
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,866
Karma: 22666666
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.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 09:58 AM.


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