summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-12-29 13:41:12 -0500
committerMatthias Clasen <mclasen@redhat.com>2022-01-28 09:03:03 -0500
commit0c5b714c17ef5efa6d8e19592cb30f0b9a608402 (patch)
tree3b384c32e7c4d45040ee777ff08cf96ffd953cc5 /tests
parent98fafa7c500a87f50d77e472153ee08806282414 (diff)
downloadpango-0c5b714c17ef5efa6d8e19592cb30f0b9a608402.tar.gz
font: Add pango_font_face_is_variable/monospace
These are really properties of the individual faces, not the family. The default implementations of these functions simply return the corresponding family value. Add some tests for the new api.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-font.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/test-font.c b/tests/test-font.c
index 2eef4396..2fa54cdf 100644
--- a/tests/test-font.c
+++ b/tests/test-font.c
@@ -455,6 +455,15 @@ test_font_models (void)
g_assert_true (pango_font_face_get_family (PANGO_FONT_FACE (obj2)) == (PangoFontFamily *)obj);
+ if (g_ascii_strcasecmp (pango_font_family_get_name (PANGO_FONT_FAMILY (obj)), "monospace") == 0)
+ g_assert_true (pango_font_face_is_monospace (PANGO_FONT_FACE (obj2)));
+
+ if (pango_font_face_is_monospace (PANGO_FONT_FACE (obj2)))
+ g_assert_true (pango_font_family_is_monospace (PANGO_FONT_FAMILY (obj)));
+
+ if (pango_font_face_is_variable (PANGO_FONT_FACE (obj2)))
+ g_assert_true (pango_font_family_is_variable (PANGO_FONT_FAMILY (obj)));
+
pango_font_face_list_sizes (PANGO_FONT_FACE (obj2), &sizes, &n_sizes);
g_assert_true ((sizes == NULL) == (n_sizes == 0));
g_free (sizes);
@@ -462,9 +471,7 @@ test_font_models (void)
if (pango_font_family_is_monospace (PANGO_FONT_FAMILY (obj)))
{
if (pango_font_face_is_synthesized (PANGO_FONT_FACE (obj2)))
- {
- monospace_found = TRUE;
- }
+ monospace_found = TRUE;
}
g_object_unref (obj2);