summaryrefslogtreecommitdiff
path: root/pango/pangofc-fontmap.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-07-30 08:51:32 -0400
committerMatthias Clasen <mclasen@redhat.com>2019-08-03 16:51:01 -0400
commitadb199cb29dccb1913b9a1b9c25a2043a492457c (patch)
tree1aa47dc3659c598385ec303c02c8712d22a738fc /pango/pangofc-fontmap.c
parent55748a5a4bf928338cf704a3f955a5bdeef1fcd4 (diff)
downloadpango-adb199cb29dccb1913b9a1b9c25a2043a492457c.tar.gz
fc: Don't list fonts with unsupported formats
We don't want to list fonts if we can't handle them.
Diffstat (limited to 'pango/pangofc-fontmap.c')
-rw-r--r--pango/pangofc-fontmap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index d8c7f227..43ab7dbc 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -1337,6 +1337,7 @@ pango_fc_font_map_list_families (PangoFontMap *fontmap,
#ifdef FC_VARIABLE
FC_VARIABLE,
#endif
+ FC_FONTFORMAT,
NULL);
FcPattern *pat = FcPatternCreate ();
GHashTable *temp_family_hash;
@@ -1358,6 +1359,10 @@ pango_fc_font_map_list_families (PangoFontMap *fontmap,
int variable;
PangoFcFamily *temp_family;
+ res = FcPatternGetString (fontset->fonts[i], FC_FONTFORMAT, 0, (FcChar8 **)(void*)&s);
+ if (strcmp (s, "Type 1") == 0 || strcmp (s, "PCF") == 0)
+ continue; /* harfbuzz does not support these */
+
res = FcPatternGetString (fontset->fonts[i], FC_FAMILY, 0, (FcChar8 **)(void*)&s);
g_assert (res == FcResultMatch);