diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2009-01-28 22:08:10 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2009-01-28 22:08:10 +0000 |
commit | 042b6e674a82f7749c9762170aef4b5fb52a4f05 (patch) | |
tree | 1c72924a5bb075e85774b8dd5c28aba45c3f2827 /pango/pangocairo-fcfont.c | |
parent | 39b9608f510de716210f02dc893e36b468e44731 (diff) | |
download | pango-042b6e674a82f7749c9762170aef4b5fb52a4f05.tar.gz |
Bug 567165 – Apply all pattern matrices
2009-01-09 Behdad Esfahbod <behdad@gnome.org>
Bug 567165 – Apply all pattern matrices
* pango/pangocairo-fcfont.c (_pango_cairo_fc_font_new):
* pango/pangofc-fontmap.c (pango_fc_font_map_new_font):
Apply all FC_MATRIX values, not just the first one. Fixes synthetic
italic rotated text with ft2 and xft backends. Can't believe no one
ever noticed that they are broken...
svn path=/trunk/; revision=2808
Diffstat (limited to 'pango/pangocairo-fcfont.c')
-rw-r--r-- | pango/pangocairo-fcfont.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/pango/pangocairo-fcfont.c b/pango/pangocairo-fcfont.c index 1c9a77aa..b583174a 100644 --- a/pango/pangocairo-fcfont.c +++ b/pango/pangocairo-fcfont.c @@ -223,8 +223,9 @@ _pango_cairo_fc_font_new (PangoCairoFcFontMap *cffontmap, PangoCairoFcFont *cffont; const FcPattern *pattern = pango_fc_font_key_get_pattern (key); cairo_matrix_t font_matrix; - FcMatrix *fc_matrix; + FcMatrix fc_matrix, *fc_matrix_val; double size; + int i; g_return_val_if_fail (PANGO_IS_CAIRO_FC_FONT_MAP (cffontmap), NULL); g_return_val_if_fail (pattern != NULL, NULL); @@ -236,16 +237,16 @@ _pango_cairo_fc_font_new (PangoCairoFcFontMap *cffontmap, size = get_font_size (pattern) / pango_matrix_get_font_scale_factor (pango_fc_font_key_get_matrix (key)); - if (FcPatternGetMatrix (pattern, - FC_MATRIX, 0, &fc_matrix) == FcResultMatch) - cairo_matrix_init (&font_matrix, - fc_matrix->xx, - - fc_matrix->yx, - - fc_matrix->xy, - fc_matrix->yy, - 0., 0.); - else - cairo_matrix_init_identity (&font_matrix); + FcMatrixInit (&fc_matrix); + for (i = 0; FcPatternGetMatrix (pattern, FC_MATRIX, i, &fc_matrix_val) == FcResultMatch; i++) + FcMatrixMultiply (&fc_matrix, &fc_matrix, fc_matrix_val); + + cairo_matrix_init (&font_matrix, + fc_matrix.xx, + - fc_matrix.yx, + - fc_matrix.xy, + fc_matrix.yy, + 0., 0.); cairo_matrix_scale (&font_matrix, size / PANGO_SCALE, size / PANGO_SCALE); |