[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.
This commit is contained in:
Brian Ewins 2007-02-11 01:42:22 +00:00
parent eec62c2975
commit 9dce321a11

View file

@ -195,26 +195,22 @@ CGAffineTransformMakeWithCairoFontScale(const cairo_matrix_t *scale)
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 };