summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-02-17 14:25:06 -0600
committerMatthias Clasen <mclasen@redhat.com>2022-02-17 14:25:06 -0600
commit0669a7c946bce99dac2c084af81b1c3ed421f19c (patch)
tree894ef4360daa9d0b0431e7791aeec0d4ac054a6a
parent7b691a04b1c737beefaa1f678898e33525fbe690 (diff)
downloadpango-0669a7c946bce99dac2c084af81b1c3ed421f19c.tar.gz
Stop using pango_itemize
Use pango_itemize_with_base_dir everywhere.
-rw-r--r--pango/ellipsize.c4
-rw-r--r--pango/pango-layout.c4
-rw-r--r--tests/test-font.c4
-rw-r--r--tests/test-itemize.c4
-rw-r--r--tests/test-shape.c4
-rw-r--r--tests/testmisc.c4
6 files changed, 18 insertions, 6 deletions
diff --git a/pango/ellipsize.c b/pango/ellipsize.c
index 9601945c..6d79e0a7 100644
--- a/pango/ellipsize.c
+++ b/pango/ellipsize.c
@@ -284,8 +284,10 @@ itemize_text (EllipsizeState *state,
{
GList *items;
PangoItem *item;
+ PangoDirection dir;
- items = pango_itemize (state->layout->context, text, 0, strlen (text), attrs, NULL);
+ dir = pango_context_get_base_dir (state->layout->context);
+ items = pango_itemize_with_base_dir (state->layout->context, dir, text, 0, strlen (text), attrs, NULL);
g_assert (g_list_length (items) == 1);
item = items->data;
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index c3ab1539..277c592a 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -3351,7 +3351,9 @@ ensure_tab_width (PangoLayout *layout)
pango_attr_list_insert_before (&tmp_attrs, attr);
}
- items = pango_itemize (layout->context, " ", 0, 1, &tmp_attrs, NULL);
+ items = pango_itemize_with_base_dir (layout->context,
+ pango_context_get_base_dir (layout->context),
+ " ", 0, 1, &tmp_attrs, NULL);
if (layout_attrs != layout->attrs)
{
diff --git a/tests/test-font.c b/tests/test-font.c
index 373467b4..4dcbd819 100644
--- a/tests/test-font.c
+++ b/tests/test-font.c
@@ -194,13 +194,15 @@ test_extents (void)
PangoRectangle ink, log;
PangoContext *context;
PangoFontDescription *desc;
+ PangoDirection dir;
context = pango_font_map_create_context (pango_cairo_font_map_get_default ());
desc = pango_font_description_from_string("Cantarell 11");
pango_context_set_font_description (context, desc);
pango_font_description_free (desc);
- items = pango_itemize (context, str, 0, strlen (str), NULL, NULL);
+ dir = pango_context_get_base_dir (context);
+ items = pango_itemize_with_base_dir (context, dir, str, 0, strlen (str), NULL, NULL);
glyphs = pango_glyph_string_new ();
item = items->data;
pango_shape (str, strlen (str), NULL, 0, &item->analysis, glyphs, PANGO_SHAPE_NONE);
diff --git a/tests/test-itemize.c b/tests/test-itemize.c
index 29b43dde..d58bdbc7 100644
--- a/tests/test-itemize.c
+++ b/tests/test-itemize.c
@@ -128,6 +128,7 @@ test_file (const gchar *filename, GString *string)
PangoAttrList *itemize_attrs;
GList *items, *l;
const char *sep = "";
+ PangoDirection dir;
g_file_get_contents (filename, &contents, &length, &error);
g_assert_no_error (error);
@@ -154,7 +155,8 @@ test_file (const gchar *filename, GString *string)
length--;
itemize_attrs = pango_attr_list_filter (attrs, affects_itemization, NULL);
- items = pango_itemize (context, text, 0, length, itemize_attrs, NULL);
+ dir = pango_context_get_base_dir (context);
+ items = pango_itemize_with_base_dir (context, dir, text, 0, length, itemize_attrs, NULL);
apply_attributes_to_items (items, attrs);
pango_attr_list_unref (itemize_attrs);
diff --git a/tests/test-shape.c b/tests/test-shape.c
index 9380976f..e5e5b07b 100644
--- a/tests/test-shape.c
+++ b/tests/test-shape.c
@@ -145,6 +145,7 @@ test_file (const gchar *filename, GString *string)
GString *s1, *s2, *s3, *s4, *s5, *s6, *s7, *s8, *s9;
char *p1;
const char *sep = "";
+ PangoDirection dir;
if (!g_file_get_contents (filename, &contents, &length, &error))
{
@@ -183,7 +184,8 @@ test_file (const gchar *filename, GString *string)
itemize_attrs = pango_attr_list_filter (attrs, affects_itemization, NULL);
shape_attrs = pango_attr_list_filter (attrs, affects_break_or_shape, NULL);
- items = pango_itemize (context, text, 0, length, itemize_attrs, NULL);
+ dir = pango_context_get_base_dir (context);
+ items = pango_itemize_with_base_dir (context, dir, text, 0, length, itemize_attrs, NULL);
apply_attributes_to_items (items, shape_attrs);
pango_attr_list_unref (itemize_attrs);
diff --git a/tests/testmisc.c b/tests/testmisc.c
index 63d21119..5d503f0d 100644
--- a/tests/testmisc.c
+++ b/tests/testmisc.c
@@ -390,11 +390,13 @@ test_fallback_shape (void)
PangoContext *context;
const char *text;
GList *items, *l;
+ PangoDirection dir;
context = pango_font_map_create_context (pango_cairo_font_map_get_default ());
+ dir = pango_context_get_base_dir (context);
text = "Some text to sha​pe ﺄﻧﺍ ﻕﺍﺩﺭ ﻊﻟﻯ ﺄﻜﻟ ﺎﻟﺰﺟﺎﺟ ﻭ ﻩﺫﺍ ﻻ ﻱﺆﻠﻤﻨﻳ";
- items = pango_itemize (context, text, 0, strlen (text), NULL, NULL);
+ items = pango_itemize_with_base_dir (context, dir, text, 0, strlen (text), NULL, NULL);
for (l = items; l; l = l->next)
{
PangoItem *item = l->data;