summaryrefslogtreecommitdiff
path: root/tests/test-layout.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-08-03 23:41:27 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-08-03 23:55:09 -0400
commit90777d89aa15fb2be260dc442d5cf4ce5a15234d (patch)
tree5cd902dae8f3e1140868b34a0d1b3f0d1a707664 /tests/test-layout.c
parente2c1cdbec788875fe02d63d801ba022ee6d75db5 (diff)
downloadpango-90777d89aa15fb2be260dc442d5cf4ce5a15234d.tar.gz
itemize: Ignore width in horizontal contextignore-width-in-horizontal2
Changes in width only need to break runs in vertical context. Update tests and add a new test. Fixes: #503
Diffstat (limited to 'tests/test-layout.c')
-rw-r--r--tests/test-layout.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test-layout.c b/tests/test-layout.c
index 8a1054b4..f35d839e 100644
--- a/tests/test-layout.c
+++ b/tests/test-layout.c
@@ -221,6 +221,7 @@ typedef struct {
gboolean auto_dir;
gboolean single_paragraph;
PangoTabArray *tabs;
+ PangoGravity gravity;
} LayoutParams;
static void
@@ -238,6 +239,7 @@ init_params (LayoutParams *params)
params->auto_dir = TRUE;
params->single_paragraph = FALSE;
params->tabs = NULL;
+ params->gravity = PANGO_GRAVITY_AUTO;
}
static void
@@ -326,6 +328,16 @@ parse_params (const char *str,
}
g_strfreev (str3);
}
+ else if (strcmp (str2[0], "gravity") == 0)
+ {
+ eclass = g_type_class_ref (PANGO_TYPE_GRAVITY);
+ ev = g_enum_get_value_by_name (eclass, str2[1]);
+ if (!ev)
+ ev = g_enum_get_value_by_nick (eclass, str2[1]);
+ if (ev)
+ params->gravity = ev->value;
+ g_type_class_unref (eclass);
+ }
g_strfreev (str2);
}
@@ -425,6 +437,8 @@ test_file (const char *filename, GString *string)
parse_params (contents, &params);
+ pango_context_set_base_gravity (context, params.gravity);
+
pango_layout_set_width (layout, params.width > 0 ? params.width * PANGO_SCALE : -1);
pango_layout_set_height (layout, params.height > 0 ? params.height * PANGO_SCALE : params.height);
pango_layout_set_indent (layout, params.indent * PANGO_SCALE);