DOCX Input: also remove & from font file names

This commit is contained in:
Kovid Goyal 2021-11-30 10:30:00 +05:30
parent 4fa03c00ff
commit e592768e83
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -189,7 +189,7 @@ class Fonts:
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)).replace(' ', '_')
fname = ascii_filename('%s - %s.%s' % (name, variant, ext)).replace(' ', '_').replace('&', '_')
with open(os.path.join(dest_dir, fname), 'wb') as dest:
dest.write(prefix)
dest.write(raw[32:])