Skip to content

Commit

Permalink
Fix font flags
Browse files Browse the repository at this point in the history
Related to #630.
  • Loading branch information
liZe committed Apr 26, 2021
1 parent 5c82013 commit f804d59
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions weasyprint/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit f804d59

Please sign in to comment.