summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2015-04-30 11:58:54 -0400
committerBehdad Esfahbod <behdad@behdad.org>2015-04-30 11:58:54 -0400
commit9f00b5319325839ccf377043feaba33635a67d7a (patch)
tree0929699f28ea0b76c29c52581556955c5e0dd415
parent96f1f8c27c696cccc963988ed4a3b3c13395133d (diff)
downloadpango-9f00b5319325839ccf377043feaba33635a67d7a.tar.gz
Bug 695163 - pangocairo hexboxes don't take actual font size into account
-rw-r--r--pango/pangocairo-font.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/pango/pangocairo-font.c b/pango/pangocairo-font.c
index 8164840e..97df00c5 100644
--- a/pango/pangocairo-font.c
+++ b/pango/pangocairo-font.c
@@ -376,8 +376,8 @@ _pango_cairo_font_private_get_hex_box_info (PangoCairoFontPrivate *cf_priv)
double size, mini_size;
PangoFontDescription *desc;
cairo_scaled_font_t *scaled_font, *scaled_mini_font;
- PangoMatrix pango_ctm;
- cairo_matrix_t cairo_ctm;
+ PangoMatrix pango_ctm, pango_font_matrix;
+ cairo_matrix_t cairo_ctm, cairo_font_matrix;
/*PangoGravity gravity;*/
if (!cf_priv)
@@ -394,10 +394,10 @@ _pango_cairo_font_private_get_hex_box_info (PangoCairoFontPrivate *cf_priv)
font_options = cairo_font_options_create ();
desc = pango_font_describe_with_absolute_size ((PangoFont *)cf_priv->cfont);
- size = pango_font_description_get_size (desc) / (1.*PANGO_SCALE);
/*gravity = pango_font_description_get_gravity (desc);*/
cairo_scaled_font_get_ctm (scaled_font, &cairo_ctm);
+ cairo_scaled_font_get_font_matrix (scaled_font, &cairo_font_matrix);
cairo_scaled_font_get_font_options (scaled_font, font_options);
/* I started adding support for vertical hexboxes here, but it's too much
* work. Easier to do with cairo user fonts and vertical writing mode
@@ -410,8 +410,15 @@ _pango_cairo_font_private_get_hex_box_info (PangoCairoFontPrivate *cf_priv)
pango_ctm.yy = cairo_ctm.yy;
pango_ctm.x0 = cairo_ctm.x0;
pango_ctm.y0 = cairo_ctm.y0;
-
- size /= pango_matrix_get_font_scale_factor (&pango_ctm);
+ pango_font_matrix.xx = cairo_font_matrix.xx;
+ pango_font_matrix.yx = cairo_font_matrix.yx;
+ pango_font_matrix.xy = cairo_font_matrix.xy;
+ pango_font_matrix.yy = cairo_font_matrix.yy;
+ pango_font_matrix.x0 = cairo_font_matrix.x0;
+ pango_font_matrix.y0 = cairo_font_matrix.y0;
+
+ size = pango_matrix_get_font_scale_factor (&pango_font_matrix) /
+ pango_matrix_get_font_scale_factor (&pango_ctm);
if (is_hinted)
{