mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 06:28:01 +02:00
quartz-font: correct and explain matrix computations
glyph_path was taking into account the translation (which currently is already applied in gstate) and the sign of the elements of the matrices was not explained.
This commit is contained in:
parent
b26f72fef9
commit
aa7e9c43b6
1 changed files with 6 additions and 7 deletions
|
|
@ -532,14 +532,12 @@ _cairo_quartz_init_glyph_path (cairo_quartz_scaled_font_t *font,
|
|||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* scale(1,-1) * font->base.scale */
|
||||
textMatrix = CGAffineTransformMake (font->base.scale.xx,
|
||||
-font->base.scale.yx,
|
||||
font->base.scale.yx,
|
||||
-font->base.scale.xy,
|
||||
font->base.scale.yy,
|
||||
font->base.scale.x0,
|
||||
font->base.scale.y0);
|
||||
|
||||
textMatrix = CGAffineTransformConcat (textMatrix, CGAffineTransformMake (1.0, 0.0, 0.0, -1.0, 0.0, 0.0));
|
||||
-font->base.scale.yy,
|
||||
0, 0);
|
||||
|
||||
glyphPath = CGFontGetGlyphPathPtr (font_face->cgFont, &textMatrix, 0, glyph);
|
||||
if (!glyphPath)
|
||||
|
|
@ -612,11 +610,12 @@ _cairo_quartz_init_glyph_surface (cairo_quartz_scaled_font_t *font,
|
|||
if (status)
|
||||
return status;
|
||||
|
||||
/* scale(1,-1) * font->base.scale * scale(1,-1) */
|
||||
textMatrix = CGAffineTransformMake (font->base.scale.xx,
|
||||
-font->base.scale.yx,
|
||||
-font->base.scale.xy,
|
||||
font->base.scale.yy,
|
||||
0.0f, 0.0f);
|
||||
0, -0);
|
||||
glyphRect = CGRectMake (bbox.origin.x / emscale,
|
||||
bbox.origin.y / emscale,
|
||||
bbox.size.width / emscale,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue