[pango/speed-up-format-filtering: 5/5] Use FcFontSetList instead of FcFontList
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/speed-up-format-filtering: 5/5] Use FcFontSetList instead of FcFontList
- Date: Sat, 22 Aug 2020 01:44:16 +0000 (UTC)
commit 0267c98c78d734a3b9b417c590e84c95e4a7e3f8
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 | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 6da07e8c..fdcbfaea 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -1655,12 +1655,14 @@ ensure_families (PangoFcFontMap *fcfontmap)
#ifdef FC_VARIABLE
FC_VARIABLE,
#endif
- FC_FONTFORMAT,
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);
@@ -1677,9 +1679,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);
@@ -2801,6 +2800,8 @@ pango_fc_face_list_sizes (PangoFontFace *face,
FcPattern *pattern;
FcFontSet *fontset;
FcObjectSet *objectset;
+ FcFontSet **sets;
+ int nsets;
*sizes = NULL;
*n_sizes = 0;
@@ -2814,7 +2815,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]