[cairo-commit] src/cairo-atsui-font.c
Brian Ewins
brianewins at kemper.freedesktop.org
Sat Mar 24 06:34:37 PDT 2007
src/cairo-atsui-font.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
New commits:
diff-tree d2cdd5eba801fc5f696d1095f237ae53c54b4e2a (from 25ddc0800490ca0222668e389412f92ccfdab91c)
Author: Brian Ewins <Brian.Ewins at gmail.com>
Date: Sat Mar 24 13:25:03 2007 +0000
[atsui] fix scaling of glyph surfaces (#9568)
Atsui glyph surface were clipped incorrectly when the text is scaled,
visible in the text-pattern test.
diff --git a/src/cairo-atsui-font.c b/src/cairo-atsui-font.c
index 7873808..8a82a7f 100644
--- a/src/cairo-atsui-font.c
+++ b/src/cairo-atsui-font.c
@@ -690,19 +690,25 @@ _cairo_atsui_scaled_font_init_glyph_surf
}
/* Compute a box to contain the glyph mask. The vertical
- * sizes come from the font extents; extra pixels are
+ * sizes come from the font extents; extra pixels are
* added to account for fractional sizes.
*/
height = extents.ascent + extents.descent + 2.0;
bottom = -extents.descent - 1.0;
+ _cairo_matrix_compute_scale_factors (&base.scale,
+ &xscale, &yscale, 1);
+ bbox = CGRectApplyAffineTransform (CGRectMake (1.0, bottom, 1.0, height), CGAffineTransformMakeScale(xscale, yscale));
+ bottom = CGRectGetMinY (bbox);
+ height = bbox.size.height;
+
/* Horizontal sizes come from the glyph typographic metrics.
* It is possible that this might result in clipped text
* in fonts where the typographic bounds don't cover the ink.
* The width is recalculated, since metricsH.width is rounded.
*/
err = ATSUGlyphGetScreenMetrics (scaled_font->style,
- 1, &theGlyph, 0, false,
+ 1, &theGlyph, 0, false,
false, &metricsH);
left = metricsH.sideBearing.x - 1.0;
width = metricsH.deviceAdvance.x
More information about the cairo-commit
mailing list