[quartz] apply ctm to text (#9568)

Applies the ctm to text output on the quartz surface. This corrects
the text-pattern test, and also corrects the size of text when the
ctm includes a scale.
This commit is contained in:
Brian Ewins 2007-03-19 18:22:44 +00:00
parent 986b0ff838
commit 12feb1f986

View file

@ -1285,13 +1285,20 @@ _cairo_quartz_surface_show_glyphs (void *abstract_surface,
* text matrix?
*/
//ND((stderr, "show_glyphs: glyph 0 at: %f, %f\n", glyphs[0].x, glyphs[0].y));
CGAffineTransform cairoTextTransform, textTransform;
CGAffineTransform cairoTextTransform, textTransform, ctm;
_cairo_quartz_cairo_matrix_to_quartz (&scaled_font->font_matrix, &cairoTextTransform);
textTransform = CGAffineTransformMakeTranslation (glyphs[0].x, glyphs[0].y);
textTransform = CGAffineTransformScale (textTransform, 1.0, -1.0);
textTransform = CGAffineTransformConcat (cairoTextTransform, textTransform);
ctm = CGAffineTransformMake (scaled_font->ctm.xx,
-scaled_font->ctm.yx,
-scaled_font->ctm.xy,
scaled_font->ctm.yy,
0., 0.);
textTransform = CGAffineTransformConcat (ctm, textTransform);
CGContextSetTextMatrix (surface->cgContext, textTransform);
CGContextSetFontSize (surface->cgContext, 1.0);