summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-01-19 08:57:27 -0500
committerMatthias Clasen <mclasen@redhat.com>2022-01-24 10:58:17 -0500
commitffd7771ae6a13f49f367be2162fea41ffeb0d3f4 (patch)
treeb37ec3da4fb6b97539b48e7aa3adc012b59b261f
parentd513c60b22b882e546af1f72cfd9db8431336dd8 (diff)
downloadpango-ffd7771ae6a13f49f367be2162fea41ffeb0d3f4.tar.gz
utils: Port pango-segmentation
-rw-r--r--utils/pango-segmentation.c13
1 files 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);