PDF Output: Ignore 4 byte differences in glyph sizes when merging. Fixes #1846982 [Conversion from ePub to PDF fails](https://bugs.launchpad.net/calibre/+bug/1846982)

This commit is contained in:
Kovid Goyal 2019-10-07 06:57:17 +05:30
parent 2207a86ea7
commit e6b44cf5fa
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -27,7 +27,7 @@ def merge_truetype_fonts_for_pdf(*fonts):
if prev_glyph_data is None:
all_glyphs[glyph_id] = glyf.glyph_data(offset, sz, as_raw=True)
else:
if sz != len(prev_glyph_data):
if abs(sz - len(prev_glyph_data)) > 4:
raise GlyphSizeMismatch('Size mismatch for glyph id: {} prev_sz: {} sz: {}'.format(glyph_id, len(prev_glyph_data), sz))
glyf = ans[b'glyf']