From f804d59cf3dfd7846befd612d00dc379c9c69bd5 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Mon, 26 Apr 2021 15:06:35 +0200 Subject: [PATCH] Fix font flags Related to #630. --- weasyprint/document.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/weasyprint/document.py b/weasyprint/document.py index 0670f3e76..e35585c95 100644 --- a/weasyprint/document.py +++ b/weasyprint/document.py @@ -100,14 +100,14 @@ def __init__(self, file_content, pango_font): @property def flags(self): - flags = 2 ** 3 # Symbolic, custom character set + flags = 2 ** (3 - 1) # Symbolic, custom character set if pango.pango_font_description_get_style(self._font_description): - flags += 2 ** 7 # Italic + flags += 2 ** (7 - 1) # Italic if b'Serif' in self.family.split(): - flags += 2 ** 2 # Serif + flags += 2 ** (2 - 1) # Serif widths = self.widths.values() if len(widths) > 1 and len(set(widths)) == 1: - flags += 2 ** 1 # FixedPitch + flags += 2 ** (1 - 1) # FixedPitch return flags