summaryrefslogtreecommitdiff
path: root/pango/pangocairo-fcfont.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2005-12-12 23:25:47 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2005-12-12 23:25:47 +0000
commit28d0dfac2179120c4b7b2fb3e185b16926097563 (patch)
tree3bfe60e15a3a3d14325e33dcc81a4dcd632f00bd /pango/pangocairo-fcfont.c
parentda3a78d96e54a69b64fca8a0ccd182c2e06ca623 (diff)
downloadpango-28d0dfac2179120c4b7b2fb3e185b16926097563.tar.gz
Fix bug #323540.
2005-12-12 Behdad Esfahbod <behdad@gnome.org> Fix bug #323540. * pangofc-fontmap.c (get_scaled_size): The logic in there is moved and renamed into pango-utils. * pango/pango-types.h, * pango/pango-utils.c (pango_matrix_get_font_scale_factor): New function. * pango/pangocairo-fcfont.c (get_font_size): Divide pixel-size by matrix font-scale-factor, since pixel-size is scaled.
Diffstat (limited to 'pango/pangocairo-fcfont.c')
-rw-r--r--pango/pangocairo-fcfont.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/pango/pangocairo-fcfont.c b/pango/pangocairo-fcfont.c
index ec7a932f..c6aeabe5 100644
--- a/pango/pangocairo-fcfont.c
+++ b/pango/pangocairo-fcfont.c
@@ -536,7 +536,8 @@ static double
get_font_size (PangoCairoFcFontMap *cffontmap,
PangoContext *context,
const PangoFontDescription *desc,
- FcPattern *pattern)
+ FcPattern *pattern,
+ PangoMatrix *matrix)
{
double size;
@@ -554,7 +555,7 @@ get_font_size (PangoCairoFcFontMap *cffontmap,
*/
if (FcPatternGetDouble (pattern, FC_PIXEL_SIZE, 0, &size) == FcResultMatch)
- return size * PANGO_SCALE;
+ return size * PANGO_SCALE / pango_matrix_get_font_scale_factor (matrix);
/* Just in case FC_PIXEL_SIZE got unset between pango_fc_make_pattern()
* and here.
@@ -603,12 +604,13 @@ _pango_cairo_fc_font_new (PangoCairoFcFontMap *cffontmap,
else
cairo_matrix_init_identity (&cffont->font_matrix);
- size = get_font_size (cffontmap, context, desc, pattern);
+ pango_ctm = pango_context_get_matrix (context);
+
+ size = get_font_size (cffontmap, context, desc, pattern, pango_ctm);
cairo_matrix_scale (&cffont->font_matrix,
size / PANGO_SCALE, size / PANGO_SCALE);
- pango_ctm = pango_context_get_matrix (context);
if (pango_ctm)
cairo_matrix_init (&cffont->ctm,
pango_ctm->xx,
@@ -619,6 +621,7 @@ _pango_cairo_fc_font_new (PangoCairoFcFontMap *cffontmap,
else
cairo_matrix_init_identity (&cffont->ctm);
+
cffont->options = cairo_font_options_copy (_pango_cairo_context_get_merged_font_options (context));
return PANGO_FC_FONT (cffont);