[pango/small-fontconfig-fixes: 2/2] Use FcFontSetList instead of FcFontList
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/small-fontconfig-fixes: 2/2] Use FcFontSetList instead of FcFontList
- Date: Wed, 19 Aug 2020 11:45:53 +0000 (UTC)
commit 349370c3951f42be04a7171f2df365775dc6e9f9
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Aug 19 07:44:02 2020 -0400
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.
pango/pangofc-fontmap.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 2dc3ab56..2afba387 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -1435,8 +1435,11 @@ ensure_families (PangoFcFontMap *fcfontmap)
NULL);
FcPattern *pat = FcPatternCreate ();
GHashTable *temp_family_hash;
+ FcFontSet **sets;
+ int nsets;
- fontset = FcFontList (priv->config, pat, os);
+ sets = pango_fc_font_map_get_config_fonts (fcfontmap, &nsets);
+ fontset = FcFontSetList (priv->config, sets, nsets, pat, os);
FcPatternDestroy (pat);
FcObjectSetDestroy (os);
@@ -1453,9 +1456,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);
@@ -2544,6 +2544,8 @@ pango_fc_face_list_sizes (PangoFontFace *face,
FcPattern *pattern;
FcFontSet *fontset;
FcObjectSet *objectset;
+ FcFontSet **sets;
+ int nsets;
*sizes = NULL;
*n_sizes = 0;
@@ -2557,7 +2559,8 @@ pango_fc_face_list_sizes (PangoFontFace *face,
objectset = FcObjectSetCreate ();
FcObjectSetAdd (objectset, FC_PIXEL_SIZE);
- fontset = FcFontList (NULL, pattern, objectset);
+ sets = pango_fc_font_map_get_config_fonts (fcface->family->fontmap, &nsets);
+ fontset = FcFontSetList (fcface->family->fontmap->priv->config, sets, nsets, pattern, objectset);
if (fontset)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]