[cairo-commit] src/cairo-atsui-font.c
Brian Ewins
brianewins at kemper.freedesktop.org
Sat Feb 10 17:42:58 PST 2007
src/cairo-atsui-font.c | 22 +++++++++-------------
1 files changed, 9 insertions(+), 13 deletions(-)
New commits:
diff-tree 9dce321a113871ade7de244d3abf9ed08f43dd85 (from eec62c297589ca20f4128c889ecad9e96736a07f)
Author: Brian Ewins <Brian.Ewins at gmail.com>
Date: Sun Feb 11 01:42:22 2007 +0000
[ATSUI] scale fonts using font size not font matrix
Mozilla bug #327522 - fonts scaled up over 16pt on mac
had nonsensical extents. The scaling was being done using
the font matrix, it turns out this does not work for 16x
scaling and up. This patch switches back to using the
font size to scale fonts, with emboldening and condensing
effects applied separately using the font matrix.
diff --git a/src/cairo-atsui-font.c b/src/cairo-atsui-font.c
index 94f431b..cdfb5c0 100644
--- a/src/cairo-atsui-font.c
+++ b/src/cairo-atsui-font.c
@@ -195,26 +195,22 @@ CGAffineTransformMakeWithCairoFontScale(
0, 0);
}
-static CGAffineTransform
-CGAffineTransformMakeWithCairoScaleFactors(const cairo_matrix_t *scale)
-{
- double xscale = 1.0;
- double yscale = 1.0;
- _cairo_matrix_compute_scale_factors(scale, &xscale, &yscale, 1);
- return CGAffineTransformMake(xscale, 0,
- 0, yscale,
- 0, 0);
-}
-
static ATSUStyle
CreateSizedCopyOfStyle(ATSUStyle inStyle, const cairo_matrix_t *scale)
{
ATSUStyle style;
OSStatus err;
+ double xscale = 1.0;
+ double yscale = 1.0;
+ CGAffineTransform theTransform;
+
+ _cairo_matrix_compute_scale_factors(scale, &xscale, &yscale, 1);
+ theTransform = CGAffineTransformMake(1.0, 0,
+ 0, yscale/xscale,
+ 0, 0);
/* Set the style's size */
- Fixed theSize = FloatToFixed(1.0);
- CGAffineTransform theTransform = CGAffineTransformMakeWithCairoScaleFactors(scale);
+ Fixed theSize = FloatToFixed(xscale);
const ATSUAttributeTag theFontStyleTags[] = { kATSUSizeTag, kATSUFontMatrixTag };
const ByteCount theFontStyleSizes[] = { sizeof(Fixed), sizeof(CGAffineTransform) };
ATSUAttributeValuePtr theFontStyleValues[] = { &theSize, &theTransform };
More information about the cairo-commit
mailing list