mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 15:13:41 +02:00
Edit book: Check book: Follow recent releases of epubcheck in expecting .ttf files to have the mime-type application/vnd.ms-opentype in EPUB 3 books
This commit is contained in:
parent
8fac38cf4d
commit
4590d36660
1 changed files with 8 additions and 2 deletions
|
|
@ -149,8 +149,14 @@ def guess_type(self, name):
|
|||
ans = guess_type(name)
|
||||
if ans == 'text/html':
|
||||
ans = 'application/xhtml+xml'
|
||||
if ans in {'application/x-font-truetype', 'application/vnd.ms-opentype'} and self.opf_version_parsed[:2] > (3, 0):
|
||||
return 'application/font-sfnt'
|
||||
if ans in {'application/x-font-truetype', 'application/vnd.ms-opentype'}:
|
||||
opfversion = self.opf_version_parsed[:2]
|
||||
if opfversion > (3, 0):
|
||||
return 'application/font-sfnt'
|
||||
if opfversion >= (3, 0):
|
||||
# bloody epubcheck has recently decided it likes this mimetype
|
||||
# for ttf files
|
||||
return 'application/vnd.ms-opentype'
|
||||
return ans
|
||||
|
||||
def decode(self, data, normalize_to_nfc=True):
|
||||
|
|
|
|||
Loading…
Reference in a new issue