summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-06-14 21:37:48 -0400
committerMatthias Clasen <mclasen@redhat.com>2022-06-22 13:57:26 -0400
commit8a0f7b51dc72c9b9baf7671f2bac519ce1bb29bb (patch)
tree7ccaa39b8c2d1c49d16754a2f3ac9eac71d4d7a2 /pango
parent795c42e3e9d2fbd012ba91336a9a875876707add (diff)
downloadpango-8a0f7b51dc72c9b9baf7671f2bac519ce1bb29bb.tar.gz
fc: Don't add empty generic families
Those are harmful, since they make us think that we have a generic family, when really, we don't.
Diffstat (limited to 'pango')
-rw-r--r--pango/pangofc-fontmap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 9ac45f1a..1bae2744 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -494,7 +494,10 @@ pango_fc_font_map_populate (PangoFontMap *map)
FcPatternDestroy (pattern);
g_hash_table_unref (families_hash);
- pango_font_map_add_family (map, PANGO_FONT_FAMILY (generic_family));
+ if (g_list_model_get_n_items (G_LIST_MODEL (generic_family)) > 0)
+ pango_font_map_add_family (map, PANGO_FONT_FAMILY (generic_family));
+ else
+ g_object_unref (generic_family);
}
FcLangSetDestroy (no_langs);