From ffd7771ae6a13f49f367be2162fea41ffeb0d3f4 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 19 Jan 2022 08:57:27 -0500 Subject: utils: Port pango-segmentation --- utils/pango-segmentation.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/utils/pango-segmentation.c b/utils/pango-segmentation.c index 31cefdbd..d0971673 100644 --- a/utils/pango-segmentation.c +++ b/utils/pango-segmentation.c @@ -62,13 +62,13 @@ show_segmentation (const char *input, PangoContext *context; gsize length; GError *error = NULL; - PangoLogAttr *attrs; + const PangoLogAttr *attrs; int len; char *p; int i; char *text; PangoAttrList *attributes; - PangoLayout *layout; + PangoSimpleLayout *layout; context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); @@ -80,11 +80,11 @@ show_segmentation (const char *input, pango_parse_markup (input, -1, 0, &attributes, &text, NULL, &error); g_assert_no_error (error); - layout = pango_layout_new (context); - pango_layout_set_text (layout, text, length); - pango_layout_set_attributes (layout, attributes); + layout = pango_simple_layout_new (context); + pango_simple_layout_set_text (layout, text, length); + pango_simple_layout_set_attributes (layout, attributes); - pango_layout_get_log_attrs (layout, &attrs, &len); + attrs = pango_simple_layout_get_log_attrs (layout, &len); for (i = 0, p = text; i < len; i++, p = g_utf8_next_char (p)) { @@ -127,7 +127,6 @@ show_segmentation (const char *input, } g_object_unref (layout); - g_free (attrs); g_free (text); pango_attr_list_unref (attributes); -- cgit v1.2.1