summaryrefslogtreecommitdiff
path: root/pango/pangofc-fontmap.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2012-12-30 18:50:42 -0600
committerBehdad Esfahbod <behdad@behdad.org>2012-12-30 18:51:43 -0600
commitf0cd936cf62c552bc6b17f6ecb70c2de783a9e80 (patch)
treea6e103fbc1fc99b2424989587a0264efd9dd5cee /pango/pangofc-fontmap.c
parent8c1a6ef147edceb05921bb892d620bdced277662 (diff)
downloadpango-f0cd936cf62c552bc6b17f6ecb70c2de783a9e80.tar.gz
Don't RenderPrepare the FcFontMatch result
After commit 7c1d6208a4b42ef3a3cce0d8dffb214c7a321e5e, the first matched font was being prepared twice, causing misconfiguration.
Diffstat (limited to 'pango/pangofc-fontmap.c')
-rw-r--r--pango/pangofc-fontmap.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 017fe44c..0188be90 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -242,7 +242,9 @@ static PangoFcPatterns *pango_fc_patterns_new (FcPattern *pat,
static PangoFcPatterns *pango_fc_patterns_ref (PangoFcPatterns *pats);
static void pango_fc_patterns_unref (PangoFcPatterns *pats);
static FcPattern *pango_fc_patterns_get_pattern (PangoFcPatterns *pats);
-static FcPattern *pango_fc_patterns_get_font_pattern (PangoFcPatterns *pats, int i);
+static FcPattern *pango_fc_patterns_get_font_pattern (PangoFcPatterns *pats,
+ int i,
+ gboolean *prepare);
static PangoFcUPattern *uniquify_pattern (PangoFcFontMap *fcfontmap,
FcPattern *pattern);
@@ -850,7 +852,7 @@ pango_fc_patterns_get_pattern (PangoFcPatterns *pats)
}
static FcPattern *
-pango_fc_patterns_get_font_pattern (PangoFcPatterns *pats, int i)
+pango_fc_patterns_get_font_pattern (PangoFcPatterns *pats, int i, gboolean *prepare)
{
if (i == 0)
{
@@ -861,7 +863,10 @@ pango_fc_patterns_get_font_pattern (PangoFcPatterns *pats, int i)
}
if (pats->match)
- return pats->match;
+ {
+ *prepare = FALSE;
+ return pats->match;
+ }
}
else
{
@@ -877,6 +882,7 @@ pango_fc_patterns_get_font_pattern (PangoFcPatterns *pats, int i)
}
}
+ *prepare = TRUE;
if (pats->fontset && i < pats->fontset->nfont)
return pats->fontset->fonts[i];
else
@@ -939,17 +945,22 @@ pango_fc_fontset_load_next_font (PangoFcFontset *fontset)
{
FcPattern *pattern, *font_pattern;
PangoFont *font;
+ gboolean prepare;
pattern = pango_fc_patterns_get_pattern (fontset->patterns);
font_pattern = pango_fc_patterns_get_font_pattern (fontset->patterns,
- fontset->patterns_i++);
+ fontset->patterns_i++,
+ &prepare);
if (G_UNLIKELY (!font_pattern))
return NULL;
- font_pattern = FcFontRenderPrepare (NULL, pattern, font_pattern);
+ if (prepare)
+ {
+ font_pattern = FcFontRenderPrepare (NULL, pattern, font_pattern);
- if (G_UNLIKELY (!font_pattern))
- return NULL;
+ if (G_UNLIKELY (!font_pattern))
+ return NULL;
+ }
#ifdef FC_PATTERN
/* The FC_PATTERN element, which points back to our the original