mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-06 03:28:09 +02:00
[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:
parent
986b0ff838
commit
12feb1f986
1 changed files with 8 additions and 1 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue