[pango/speed-up-format-filtering: 5/5] Use FcFontSetList instead of FcFontList




commit a4d01c43469e4df0cc3e0c60933551efb4aa3098
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 5a418a60..e3c210f7 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]