From fe2f0c6993c3536b153165606f3f246ea9224ca8 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Mon, 16 Oct 2023 10:20:27 +0200 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20crash=20with=20bitmap=20fonts?= =?UTF-8?q?=20with=20no=20"glyf"=20table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weasyprint/pdf/stream.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/weasyprint/pdf/stream.py b/weasyprint/pdf/stream.py index e2a126f4b..e0ceb2c62 100644 --- a/weasyprint/pdf/stream.py +++ b/weasyprint/pdf/stream.py @@ -73,8 +73,9 @@ def __init__(self, pango_font): else: self.bitmap = ( 'EBDT' in self.ttfont and - 'EBLC' in self.ttfont and - not self.ttfont['glyf'].glyphs) + 'EBLC' in self.ttfont and ( + 'glyf' not in self.ttfont or + not self.ttfont['glyf'].glyphs)) # Various properties self.italic_angle = 0 # TODO: this should be different