Skip to content

Commit

Permalink
Fix variable font instantiation, part three (Kozea#1981)
Browse files Browse the repository at this point in the history
Adds italic naming to font metadata where appropriate
  • Loading branch information
pmjdebruijn committed Oct 20, 2023
1 parent 08086a8 commit b809e20
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions weasyprint/pdf/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ def __init__(self, pango_font):
if 950 < self.variations['wght'] <= 1000:
pango.pango_font_description_set_weight(self.description,
pango.PANGO_WEIGHT_ULTRAHEAVY)
if 'slnt' in self.variations:
if self.variations['slnt'] != 0:
pango.pango_font_description_set_style(self.description,
pango.PANGO_STYLE_ITALIC)

description_string = ffi.string(
pango.pango_font_description_to_string(description))
Expand Down

0 comments on commit b809e20

Please sign in to comment.