From 088e06da0e7b475eb7fe76481b38ae84469a0168 Mon Sep 17 00:00:00 2001 From: Lucie Anglade Date: Fri, 8 May 2020 00:24:30 +0200 Subject: [PATCH] Use the saved pango_font --- weasyprint/document.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weasyprint/document.py b/weasyprint/document.py index 2826d0fa..b52d9ae7 100644 --- a/weasyprint/document.py +++ b/weasyprint/document.py @@ -94,13 +94,13 @@ class Font(): self.glyphs += ( glyph_string.glyphs[x].glyph for x in range(num_glyphs)) - def compute_font_bbox(self, pango_font): + def compute_font_bbox(self): font_bbox = None ink_rect = ffi.new('PangoRectangle *') for glyph in self.glyphs: pango.pango_font_get_glyph_extents( - pango_font, glyph, ink_rect, ffi.NULL) + self.pango_font, glyph, ink_rect, ffi.NULL) if font_bbox is None: font_bbox = [ ink_rect.x, ink_rect.y, ink_rect.width, ink_rect.height]