From d1c22611b35bd050509850894419f307f56ad6fc Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 2 Apr 2021 13:55:48 +0530 Subject: [PATCH] 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) --- src/calibre/ebooks/docx/fonts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/docx/fonts.py b/src/calibre/ebooks/docx/fonts.py index 4d85968272..de118fb514 100644 --- a/src/calibre/ebooks/docx/fonts.py +++ b/src/calibre/ebooks/docx/fonts.py @@ -189,7 +189,7 @@ class Fonts(object): if not is_truetype_font(prefix): return None 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: dest.write(prefix) dest.write(raw[32:])