summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-02-05 12:44:38 +0100
committerMatthias Clasen <mclasen@redhat.com>2022-02-13 14:27:17 -0600
commite7dba0ea8a9132d075bf61b89d4f83ce84d75c40 (patch)
treed9984c92e71f55e76942110c24b660ba5ef63eb6
parente05c0ed80a0706176c96fc7958848563a1abb45c (diff)
downloadpango-userfont.tar.gz
testhbfont: update for generic familiesuserfont
-rw-r--r--tests/testhbfont.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/testhbfont.c b/tests/testhbfont.c
index df37eaea..6b6860a9 100644
--- a/tests/testhbfont.c
+++ b/tests/testhbfont.c
@@ -628,13 +628,15 @@ compare_family_name (gconstpointer a,
}
static gboolean
-is_generic_family (PangoFontMap *map,
- const char *family)
+is_generic_family (PangoFontFamily *fam)
{
- if (PANGO_IS_FC_HB_FONT_MAP (map))
- return g_strv_contains ((const char *[]){ "sans-serif", "serif", "monospace", "system-ui", "cursive", "fantasy", "emoji", NULL}, family);
- else
- return g_strv_contains ((const char *[]){ "Sans", "Serif", "Monospace", "System-ui", NULL}, family);
+ return g_str_equal (G_OBJECT_TYPE_NAME (fam), "PangoGenericFamily");
+}
+
+static gboolean
+is_generic_family_name (const char *family)
+{
+ return g_strv_contains ((const char *[]){ "Sans", "Serif", "Monospace", "System-ui", NULL}, family);
}
static const char * const *
@@ -647,7 +649,7 @@ collect_nongeneric_families (PangoFontMap *map)
PangoFontFamily *fam = g_list_model_get_item (G_LIST_MODEL (map), i);
const char *name = pango_font_family_get_name (fam);
- if (!is_generic_family (map, name))
+ if (!(is_generic_family (fam) || is_generic_family_name (name)))
g_ptr_array_add (array, (gpointer)name);
g_object_unref (fam);