diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-02-17 14:35:38 -0600 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-02-17 14:35:38 -0600 |
commit | c534378d03563681a2c48b5816b24b307d9f19eb (patch) | |
tree | 32432a45c9b6f40fc214ed03cfd38304dad2ff55 | |
parent | 6e6f2d674630b9ebe2d2c70a37d436d5fc1a1258 (diff) | |
download | pango-c534378d03563681a2c48b5816b24b307d9f19eb.tar.gz |
Rename pango_itemize_with_base_dir
Call it just pango_itemize.
-rw-r--r-- | docs/pango_rendering.md | 3 | ||||
-rw-r--r-- | pango/ellipsize.c | 2 | ||||
-rw-r--r-- | pango/itemize.c | 27 | ||||
-rw-r--r-- | pango/pango-direction.h | 2 | ||||
-rw-r--r-- | pango/pango-item.h | 14 | ||||
-rw-r--r-- | pango/pango-layout.c | 6 | ||||
-rw-r--r-- | tests/test-font.c | 2 | ||||
-rw-r--r-- | tests/test-itemize.c | 2 | ||||
-rw-r--r-- | tests/test-shape.c | 2 | ||||
-rw-r--r-- | tests/testmisc.c | 6 |
10 files changed, 34 insertions, 32 deletions
diff --git a/docs/pango_rendering.md b/docs/pango_rendering.md index 4bec5176..fe80ef3f 100644 --- a/docs/pango_rendering.md +++ b/docs/pango_rendering.md @@ -16,8 +16,7 @@ various stages of this pipeline and the APIs that implement them. Itemization : breaks a piece of text into segments with consistent direction and shaping properties. Among other things, this determines which font to use for each - character. Use [func@Pango.itemize] or [func@Pango.itemize_with_base_dir] - to itemize text. + character. Use [func@Pango.itemize] to itemize text. Shaping : converts characters into glyphs. Use [func@Pango.shape], diff --git a/pango/ellipsize.c b/pango/ellipsize.c index a1798f58..5714ccce 100644 --- a/pango/ellipsize.c +++ b/pango/ellipsize.c @@ -287,7 +287,7 @@ itemize_text (EllipsizeState *state, PangoDirection dir; dir = pango_context_get_base_dir (state->layout->context); - items = pango_itemize_with_base_dir (state->layout->context, dir, text, 0, strlen (text), attrs); + items = pango_itemize (state->layout->context, dir, text, 0, strlen (text), attrs); g_assert (g_list_length (items) == 1); item = items->data; diff --git a/pango/itemize.c b/pango/itemize.c index a6fa955f..04d798d8 100644 --- a/pango/itemize.c +++ b/pango/itemize.c @@ -1528,8 +1528,8 @@ post_process_items (PangoContext *context, /* }}} */ /* {{{ Private API */ -/* Like pango_itemize_with_base_dir, but takes a font description. - * In contrast to pango_itemize_with_base_dir, this function does +/* Like pango_itemize, but takes a font description. + * In contrast to pango_itemize, this function does * not call pango_itemize_post_process_items, so you need to do that * separately, after applying attributes that affect segmentation and * computing the log attrs. @@ -1578,7 +1578,7 @@ pango_itemize_post_process_items (PangoContext *context, /* {{{ Public API */ /** - * pango_itemize_with_base_dir: + * pango_itemize: * @context: a structure holding information that affects * the itemization process. * @base_dir: base direction to use for bidirectional processing @@ -1588,7 +1588,12 @@ pango_itemize_post_process_items (PangoContext *context, * after @start_index. This must be >= 0. * @attrs: the set of attributes that apply to @text. * - * Like `pango_itemize()`, but with an explicitly specified base direction. + * Breaks a piece of text into segments with consistent directional + * level and font. + * + * Each byte of @text will be contained in exactly one of the items in the + * returned list; the generated list of items will be in logical order (the + * start offsets of the items are ascending). * * The base direction is used when computing bidirectional levels. * [func@itemize] gets the base direction from the `PangoContext` @@ -1597,16 +1602,14 @@ pango_itemize_post_process_items (PangoContext *context, * Return value: (transfer full) (element-type Pango.Item): a `GList` of * [struct@Pango.Item] structures. The items should be freed using * [method@Pango.Item.free] probably in combination with [func@GLib.List.free_full]. - * - * Since: 1.4 */ GList * -pango_itemize_with_base_dir (PangoContext *context, - PangoDirection base_dir, - const char *text, - int start_index, - int length, - PangoAttrList *attrs) +pango_itemize (PangoContext *context, + PangoDirection base_dir, + const char *text, + int start_index, + int length, + PangoAttrList *attrs) { GList *items; diff --git a/pango/pango-direction.h b/pango/pango-direction.h index 24d3c50e..455e7456 100644 --- a/pango/pango-direction.h +++ b/pango/pango-direction.h @@ -46,7 +46,7 @@ G_BEGIN_DECLS * and [func@find_base_dir] cannot be `PANGO_DIRECTION_WEAK_LTR` or * `PANGO_DIRECTION_WEAK_RTL`, since every character is either neutral * or has a strong direction; on the other hand `PANGO_DIRECTION_NEUTRAL` - * doesn't make sense to pass to [func@itemize_with_base_dir]. + * doesn't make sense to pass to [func@itemize]. * * The `PANGO_DIRECTION_TTB_LTR`, `PANGO_DIRECTION_TTB_RTL` values come from * an earlier interpretation of this enumeration as the writing direction diff --git a/pango/pango-item.h b/pango/pango-item.h index f98e6d62..d04de33d 100644 --- a/pango/pango-item.h +++ b/pango/pango-item.h @@ -136,13 +136,13 @@ GList * pango_reorder_items (GList *items); /* Itemization */ -PANGO_AVAILABLE_IN_1_4 -GList * pango_itemize_with_base_dir (PangoContext *context, - PangoDirection base_dir, - const char *text, - int start_index, - int length, - PangoAttrList *attrs); +PANGO_AVAILABLE_IN_ALL +GList * pango_itemize (PangoContext *context, + PangoDirection base_dir, + const char *text, + int start_index, + int length, + PangoAttrList *attrs); G_END_DECLS diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 295e30b9..cf513afb 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -3351,9 +3351,9 @@ ensure_tab_width (PangoLayout *layout) pango_attr_list_insert_before (&tmp_attrs, attr); } - items = pango_itemize_with_base_dir (layout->context, - pango_context_get_base_dir (layout->context), - " ", 0, 1, &tmp_attrs); + items = pango_itemize (layout->context, + pango_context_get_base_dir (layout->context), + " ", 0, 1, &tmp_attrs); if (layout_attrs != layout->attrs) { diff --git a/tests/test-font.c b/tests/test-font.c index 25589655..4aa2fc58 100644 --- a/tests/test-font.c +++ b/tests/test-font.c @@ -202,7 +202,7 @@ test_extents (void) pango_font_description_free (desc); dir = pango_context_get_base_dir (context); - items = pango_itemize_with_base_dir (context, dir, str, 0, strlen (str), NULL); + items = pango_itemize (context, dir, str, 0, strlen (str), 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 f917520f..80e02cc9 100644 --- a/tests/test-itemize.c +++ b/tests/test-itemize.c @@ -156,7 +156,7 @@ test_file (const gchar *filename, GString *string) itemize_attrs = pango_attr_list_filter (attrs, affects_itemization, NULL); dir = pango_context_get_base_dir (context); - items = pango_itemize_with_base_dir (context, dir, text, 0, length, itemize_attrs); + items = pango_itemize (context, dir, text, 0, length, itemize_attrs); 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 2f8ab015..6b90acb1 100644 --- a/tests/test-shape.c +++ b/tests/test-shape.c @@ -185,7 +185,7 @@ test_file (const gchar *filename, GString *string) shape_attrs = pango_attr_list_filter (attrs, affects_break_or_shape, NULL); dir = pango_context_get_base_dir (context); - items = pango_itemize_with_base_dir (context, dir, text, 0, length, itemize_attrs); + items = pango_itemize (context, dir, text, 0, length, itemize_attrs); apply_attributes_to_items (items, shape_attrs); pango_attr_list_unref (itemize_attrs); diff --git a/tests/testmisc.c b/tests/testmisc.c index 93fc3cec..ce5f2b05 100644 --- a/tests/testmisc.c +++ b/tests/testmisc.c @@ -49,7 +49,7 @@ test_itemize_empty_crash (void) PangoContext *context; context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); - pango_itemize_with_base_dir (context, PANGO_DIRECTION_LTR, "", 0, 1, NULL); + pango_itemize (context, PANGO_DIRECTION_LTR, "", 0, 1, NULL); g_object_unref (context); } @@ -61,7 +61,7 @@ test_itemize_utf8 (void) GList *result = NULL; context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); - result = pango_itemize_with_base_dir (context, PANGO_DIRECTION_LTR, "\xc3\xa1\na", 3, 1, NULL); + result = pango_itemize (context, PANGO_DIRECTION_LTR, "\xc3\xa1\na", 3, 1, NULL); g_assert (result != NULL); g_list_free_full (result, (GDestroyNotify)pango_item_free); @@ -396,7 +396,7 @@ test_fallback_shape (void) dir = pango_context_get_base_dir (context); text = "Some text to shape ﺄﻧﺍ ﻕﺍﺩﺭ ﻊﻟﻯ ﺄﻜﻟ ﺎﻟﺰﺟﺎﺟ ﻭ ﻩﺫﺍ ﻻ ﻱﺆﻠﻤﻨﻳ"; - items = pango_itemize_with_base_dir (context, dir, text, 0, strlen (text), NULL); + items = pango_itemize (context, dir, text, 0, strlen (text), NULL); for (l = items; l; l = l->next) { PangoItem *item = l->data; |