[pango/pango2: 85/201] Port utils to PangoSimpleLayout
- From: Matthias Clasen <matthiasc src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [pango/pango2: 85/201] Port utils to PangoSimpleLayout
 
- Date: Sat, 11 Jun 2022 02:22:29 +0000 (UTC)
 
commit 84bf33f4d89be9a401b0698b219c6f898ab3c1ed
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jan 19 08:57:27 2022 -0500
    Port utils to PangoSimpleLayout
 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 65734dc4..179def49 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);
 
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]