mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
DOCX Input: When converting embedded fonts, replace spaces in the filename with underscores to keep the execrable epubcheck happy. Fixes #1921793 [Conversion Problem: Embedded OpenType TT fonts in DOCX files](https://bugs.launchpad.net/calibre/+bug/1921793)
This commit is contained in:
parent
d8649c6fed
commit
d1c22611b3
@ -189,7 +189,7 @@ class Fonts(object):
|
|||||||
if not is_truetype_font(prefix):
|
if not is_truetype_font(prefix):
|
||||||
return None
|
return None
|
||||||
ext = 'otf' if prefix.startswith(b'OTTO') else 'ttf'
|
ext = 'otf' if prefix.startswith(b'OTTO') else 'ttf'
|
||||||
fname = ascii_filename('%s - %s.%s' % (name, variant, ext))
|
fname = ascii_filename('%s - %s.%s' % (name, variant, ext)).replace(' ', '_')
|
||||||
with open(os.path.join(dest_dir, fname), 'wb') as dest:
|
with open(os.path.join(dest_dir, fname), 'wb') as dest:
|
||||||
dest.write(prefix)
|
dest.write(prefix)
|
||||||
dest.write(raw[32:])
|
dest.write(raw[32:])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user