[pango/speed-up-format-filtering: 7/7] Use FcFontSetList instead of FcFontList
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/speed-up-format-filtering: 7/7] Use FcFontSetList instead of FcFontList
- Date: Sat, 22 Aug 2020 01:54:37 +0000 (UTC)
commit 898d1ff03f69993ddd83ba852f6768ba78f47950
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 6da07e8c..fbe9eb95 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -1659,8 +1659,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);
@@ -1677,9 +1680,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 +2801,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 +2816,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]