[pango/speed-up-format-filtering: 166/169] Use FcFontSetList instead of FcFontList
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/speed-up-format-filtering: 166/169] Use FcFontSetList instead of FcFontList
- Date: Mon, 22 Feb 2021 13:27:27 +0000 (UTC)
commit 229975a376010b28b2e5d3b7699313a3b4910ca9
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 6cecfeac..1720818a 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -1460,8 +1460,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);
@@ -1478,9 +1480,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);
@@ -2674,6 +2673,7 @@ pango_fc_face_list_sizes (PangoFontFace *face,
FcPattern *pattern;
FcFontSet *fontset;
FcObjectSet *objectset;
+ FcFontSet *fonts;
*sizes = NULL;
*n_sizes = 0;
@@ -2687,7 +2687,8 @@ pango_fc_face_list_sizes (PangoFontFace *face,
objectset = FcObjectSetCreate ();
FcObjectSetAdd (objectset, FC_PIXEL_SIZE);
- fontset = FcFontList (fcface->family->fontmap->priv->config, 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]