diff --git a/weasyprint/document.py b/weasyprint/document.py index 87d5755bee..5caf991add 100644 --- a/weasyprint/document.py +++ b/weasyprint/document.py @@ -1227,13 +1227,14 @@ def write_pdf(self, target=None, zoom=1, attachments=None, finisher=None): try: ttfont = TTFont(full_font) options = subset.Options( - retain_gids=True, passthrough_tables=True) + retain_gids=True, passthrough_tables=True, + ignore_missing_glyphs=True, notdef_glyph=True) subsetter = subset.Subsetter(options) subsetter.populate(gids=cmap) subsetter.subset(ttfont) ttfont.save(optimized_font) content = optimized_font.getvalue() - except (TTLibError, subset.Subsetter.SubsettingError): + except TTLibError: LOGGER.warning('Unable to optimize font') content = fonts[0].file_content else: