diff --git a/weasyprint/text.py b/weasyprint/text.py index fd0798a88..28eb5ee53 100644 --- a/weasyprint/text.py +++ b/weasyprint/text.py @@ -205,6 +205,8 @@ void pango_attr_list_unref (PangoAttrList *list); void pango_attr_list_insert ( PangoAttrList *list, PangoAttribute *attr); + void pango_attr_list_change ( + PangoAttrList *list, PangoAttribute *attr); PangoAttribute * pango_attr_font_features_new (const gchar *features); PangoAttribute * pango_attr_letter_spacing_new (int letter_spacing); void pango_attribute_destroy (PangoAttribute *attr); @@ -776,7 +778,7 @@ def add_attr(start, end, spacing): # TODO: attributes should be freed attr = pango.pango_attr_letter_spacing_new(spacing) attr.start_index, attr.end_index = start, end - pango.pango_attr_list_insert(attr_list, attr) + pango.pango_attr_list_change(attr_list, attr) add_attr(0, len(bytestring) + 1, letter_spacing) position = bytestring.find(b' ')