diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-01-23 21:06:55 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-01-25 15:29:16 -0500 |
commit | d2602cc0ee6a0b7abb982e27ccf90b0da98ebedf (patch) | |
tree | 883cdb2cb8533cd08368decda9680f4f3e698a02 /tests/testiter.c | |
parent | 45762d6b50b29447ee97c759c7a7cc55cb534703 (diff) | |
download | pango-d2602cc0ee6a0b7abb982e27ccf90b0da98ebedf.tar.gz |
Make PangoLayoutRun a separate type
It is nicer to have an opaque type for
the iter, and only use PangoGlyphItem
in the implementation.
Diffstat (limited to 'tests/testiter.c')
-rw-r--r-- | tests/testiter.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/tests/testiter.c b/tests/testiter.c index 7327e1df..5ac2f7c9 100644 --- a/tests/testiter.c +++ b/tests/testiter.c @@ -81,7 +81,7 @@ iter_char_test (PangoLayout *layout) { PangoRectangle extents, run_extents; PangoLayoutIter *iter; - PangoGlyphItem *run; + PangoLayoutRun *run; int num_chars; int i, index, offset; int leading_x, trailing_x, x0, x1; @@ -117,26 +117,31 @@ iter_char_test (PangoLayout *layout) { PangoFontDescription *desc; char *str; + PangoItem *item; + PangoGlyphString *glyphs; + + item = pango_layout_run_get_item (run); + glyphs = pango_layout_run_get_glyphs (run); /* Get needed data for the GlyphString */ pango_layout_iter_get_run_extents (iter, NULL, &run_extents); - offset = run->item->offset; - rtl = run->item->analysis.level%2; - desc = pango_font_describe (run->item->analysis.font); + offset = item->offset; + rtl = item->analysis.level%2; + desc = pango_font_describe (item->analysis.font); str = pango_font_description_to_string (desc); verbose (" (current run: font=%s,offset=%d,x=%d,len=%d,rtl=%d)\n", - str, offset, run_extents.x, run->item->length, rtl); + str, offset, run_extents.x, item->length, rtl); g_free (str); pango_font_description_free (desc); /* Calculate expected x result using index_to_x */ - pango_glyph_string_index_to_x (run->glyphs, - (char *)(text + offset), run->item->length, - &run->item->analysis, + pango_glyph_string_index_to_x (glyphs, + (char *)(text + offset), item->length, + &item->analysis, index - offset, FALSE, &leading_x); - pango_glyph_string_index_to_x (run->glyphs, - (char *)(text + offset), run->item->length, - &run->item->analysis, + pango_glyph_string_index_to_x (glyphs, + (char *)(text + offset), item->length, + &item->analysis, index - offset, TRUE, &trailing_x); x0 = run_extents.x + MIN (leading_x, trailing_x); |