summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pango/pangocairo-fcfontmap.c2
-rw-r--r--pango/pangofc-fontmap.c24
2 files changed, 17 insertions, 9 deletions
diff --git a/pango/pangocairo-fcfontmap.c b/pango/pangocairo-fcfontmap.c
index bd3a8583..015b8170 100644
--- a/pango/pangocairo-fcfontmap.c
+++ b/pango/pangocairo-fcfontmap.c
@@ -103,7 +103,7 @@ pango_cairo_fc_font_map_fontset_key_substitute (PangoFcFontMap *fcfontmap G_G
PangoFcFontsetKey *fontkey,
FcPattern *pattern)
{
- FcConfigSubstitute (NULL, pattern, FcMatchPattern);
+ FcConfigSubstitute (pango_fc_font_map_get_config (fcfontmap), pattern, FcMatchPattern);
if (fontkey)
cairo_ft_font_options_substitute (pango_fc_fontset_key_get_context_key (fontkey),
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index ec504094..4c2aa094 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -848,7 +848,10 @@ filter_fontset_by_format (FcFontSet *fontset)
for (i = 0; i < fontset->nfont; i++)
{
if (pango_fc_is_supported_font_format (fontset->fonts[i]))
- FcFontSetAdd (result, FcPatternDuplicate (fontset->fonts[i]));
+ {
+ FcPatternReference (fontset->fonts[i]);
+ FcFontSetAdd (result, fontset->fonts[i]);
+ }
}
return result;
@@ -873,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)
{