summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pango/pangofc-fontmap.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 6d7ae3aa..4c2aa094 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -876,16 +876,21 @@ pango_fc_patterns_get_font_pattern (PangoFcPatterns *pats, int i, gboolean *prep
if (!pats->fontset)
{
FcResult result;
- FcFontSet *fontset;
- FcFontSet *filtered;
+ FcFontSet *filtered[2] = { NULL, };
+ int i, n = 0;
- fontset = FcFontSort (pats->fontmap->priv->config, pats->pattern, FcFalse, NULL, &result);
- filtered = filter_fontset_by_format (fontset);
- FcFontSetDestroy (fontset);
+ for (i = 0; i < 2; i++)
+ {
+ FcFontSet *fonts = FcConfigGetFonts (pats->fontmap->priv->config, i);
+ if (fonts)
+ filtered[n++] = filter_fontset_by_format (fonts);
+ }
+
+ pats->fontset = FcFontSetSort (pats->fontmap->priv->config, filtered, n, pats->pattern, FcTrue, NULL, &result);
- pats->fontset = FcFontSetSort (pats->fontmap->priv->config, &filtered, 1, pats->pattern, FcTrue, NULL, &result);
+ for (i = 0; i < n; i++)
+ FcFontSetDestroy (filtered[i]);
- FcFontSetDestroy (filtered);
if (pats->match)
{