summaryrefslogtreecommitdiff
path: root/pango/pangofc-fontmap.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-08-19 07:44:02 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-02-22 08:27:16 -0500
commit229975a376010b28b2e5d3b7699313a3b4910ca9 (patch)
tree91d39e37f9806aa7159b59fae209b1624ae58ea0 /pango/pangofc-fontmap.c
parent95022977ef9ac94d0d38a3ff72e327da0b46950b (diff)
downloadpango-229975a376010b28b2e5d3b7699313a3b4910ca9.tar.gz
Use FcFontSetList instead of FcFontList
We have filtered-by-format lists of fonts available now, so we should use them to ensure we always operate on the same set of fonts. Also, fix another case of passing NULL for the config.
Diffstat (limited to 'pango/pangofc-fontmap.c')
-rw-r--r--pango/pangofc-fontmap.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 6cecfeac..1720818a 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -1460,8 +1460,10 @@ ensure_families (PangoFcFontMap *fcfontmap)
NULL);
FcPattern *pat = FcPatternCreate ();
GHashTable *temp_family_hash;
+ FcFontSet *fonts;
- fontset = FcFontList (priv->config, pat, os);
+ fonts = pango_fc_font_map_get_config_fonts (fcfontmap);
+ fontset = FcFontSetList (priv->config, &fonts, 1, pat, os);
FcPatternDestroy (pat);
FcObjectSetDestroy (os);
@@ -1478,9 +1480,6 @@ ensure_families (PangoFcFontMap *fcfontmap)
int variable;
PangoFcFamily *temp_family;
- if (!pango_fc_is_supported_font_format (fontset->fonts[i]))
- continue;
-
res = FcPatternGetString (fontset->fonts[i], FC_FAMILY, 0, (FcChar8 **)(void*)&s);
g_assert (res == FcResultMatch);
@@ -2674,6 +2673,7 @@ pango_fc_face_list_sizes (PangoFontFace *face,
FcPattern *pattern;
FcFontSet *fontset;
FcObjectSet *objectset;
+ FcFontSet *fonts;
*sizes = NULL;
*n_sizes = 0;
@@ -2687,7 +2687,8 @@ pango_fc_face_list_sizes (PangoFontFace *face,
objectset = FcObjectSetCreate ();
FcObjectSetAdd (objectset, FC_PIXEL_SIZE);
- fontset = FcFontList (fcface->family->fontmap->priv->config, pattern, objectset);
+ fonts = pango_fc_font_map_get_config_fonts (fcface->family->fontmap);
+ fontset = FcFontSetList (fcface->family->fontmap->priv->config, &fonts, 1, pattern, objectset);
if (fontset)
{