summaryrefslogtreecommitdiff
path: root/tests/test-shape.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-08-27 10:31:41 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-08-27 11:43:46 -0400
commit609a00c9866037f2b9e05ec9c70071407e2f673f (patch)
tree7e725a382578f17005a72b448c327977423335a6 /tests/test-shape.c
parentb144b6ad9da20c294adc07cd3bd26a4bdbfa3736 (diff)
downloadpango-609a00c9866037f2b9e05ec9c70071407e2f673f.tar.gz
test-shape: Show cluster boundaries correctly
Cluster boundaries were cutting off the first character of a new cluster. Not great if the tools print out misleading information.
Diffstat (limited to 'tests/test-shape.c')
-rw-r--r--tests/test-shape.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/tests/test-shape.c b/tests/test-shape.c
index 94773bb8..674c6cc9 100644
--- a/tests/test-shape.c
+++ b/tests/test-shape.c
@@ -218,6 +218,18 @@ test_file (const gchar *filename, GString *string)
int len;
PangoGlyphInfo *gi = &glyphs->glyphs[i];
+
+ if (gi->attr.is_cluster_start && i > 0)
+ {
+ g_string_append (s1, " ");
+ g_string_append (s2, "|");
+ g_string_append (s3, "|");
+ g_string_append (s4, "|");
+ g_string_append (s5, " ");
+ g_string_append (s6, " ");
+ g_string_append (s7, "|");
+ }
+
char *p;
p = text + item->offset + glyphs->log_clusters[i];
if (rtl)
@@ -258,17 +270,6 @@ test_file (const gchar *filename, GString *string)
g_string_append_printf (s5, "%*s", len - (int)g_utf8_strlen (s5->str, s5->len), "");
g_string_append_printf (s6, "%*s", len - (int)g_utf8_strlen (s6->str, s6->len), "");
g_string_append_printf (s7, "%*s", len - (int)g_utf8_strlen (s7->str, s7->len), "");
-
- if (gi->attr.is_cluster_start && i + 1 < glyphs->num_glyphs)
- {
- g_string_append (s1, " ");
- g_string_append (s2, "|");
- g_string_append (s3, "|");
- g_string_append (s4, "|");
- g_string_append (s5, " ");
- g_string_append (s6, " ");
- g_string_append (s7, "|");
- }
}
pango_glyph_string_free (glyphs);