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




commit 690e0c57a6ac0e97bbd4494ef5f64a7cd01037f7
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 | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index b8c96338..0aed3a27 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -1453,8 +1453,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);
@@ -1471,9 +1473,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);
 
@@ -2579,6 +2578,7 @@ pango_fc_face_list_sizes (PangoFontFace  *face,
   FcPattern *pattern;
   FcFontSet *fontset;
   FcObjectSet *objectset;
+  FcFontSet *fonts;
 
   *sizes = NULL;
   *n_sizes = 0;
@@ -2592,7 +2592,8 @@ pango_fc_face_list_sizes (PangoFontFace  *face,
   objectset = FcObjectSetCreate ();
   FcObjectSetAdd (objectset, FC_PIXEL_SIZE);
 
-  fontset = FcFontList (NULL, 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)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]