diff --git a/weasyprint/text/ffi.py b/weasyprint/text/ffi.py index f57da3c28..b8162ce8a 100644 --- a/weasyprint/text/ffi.py +++ b/weasyprint/text/ffi.py @@ -329,7 +329,7 @@ char * pango_font_description_to_string (const PangoFontDescription *desc); - PangoFontDescription * pango_font_describe (PangoFont *font); + PangoFontDescription * pango_font_describe_with_absolute_size (PangoFont *font); const char * pango_font_description_get_family (const PangoFontDescription *desc); guint pango_font_description_hash (const PangoFontDescription *desc); diff --git a/weasyprint/text/fonts.py b/weasyprint/text/fonts.py index 07b57d1a6..8a6884742 100644 --- a/weasyprint/text/fonts.py +++ b/weasyprint/text/fonts.py @@ -383,7 +383,8 @@ def get_pango_font_key(pango_font): # the same address for two different Pango maps. We should cache it in the # FontConfiguration object. See issue #2144. description = ffi.gc( - pango.pango_font_describe(pango_font), pango.pango_font_description_free) + pango.pango_font_describe_with_absolute_size(pango_font), + pango.pango_font_description_free) font_size = pango.pango_font_description_get_size(description) * FROM_UNITS mask = pango.PANGO_FONT_MASK_SIZE + pango.PANGO_FONT_MASK_GRAVITY pango.pango_font_description_unset_fields(description, mask)