Skip to content

Commit

Permalink
Don’t crash with Pango 1.42
Browse files Browse the repository at this point in the history
Debian stable (Buster, 10) includes Pango 1.42. Until the next version of
Debian (Bullseye, 11) is released, keep a workaround to avoid crashes.

This workaround is not documented on purpose, support of Pango 1.42 will not be
improved. Also note that WeasyPrint with Pango 1.42 will suffer from #1199.

Fix #1384.
  • Loading branch information
liZe committed Jul 18, 2021
1 parent 5fba476 commit 51b90ec
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion weasyprint/text/line_break.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ def setup(self, context, font_size, style):
pango_context = ffi.gc(
pango.pango_font_map_create_context(font_map),
gobject.g_object_unref)
pango.pango_context_set_round_glyph_positions(pango_context, False)
try:
pango.pango_context_set_round_glyph_positions(pango_context, False)
except AttributeError:
# TODO: remove this when Cairo 1.44+ is in Debian 11 is released.
# See https://github.com/Kozea/WeasyPrint/issues/1384.
pass
self.layout = ffi.gc(
pango.pango_layout_new(pango_context),
gobject.g_object_unref)
Expand Down

0 comments on commit 51b90ec

Please sign in to comment.