diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2016-11-13 18:59:44 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2016-11-13 19:06:21 +0200 |
commit | ebfe8bb2b2cfc3dba063260bf746db923a3693f2 (patch) | |
tree | 54375338480277b02663bbf88c845d294364a8c4 /vcl/quartz | |
parent | e760de7db53a6ccfa0b4732d9c4639441dc22434 (diff) |
tdf#103895: Another fix too macOS glyph bounding
Apply font rotation when calculating glyph bounding rectangle.
Change-Id: I9c533ec3b33a5858d46b60d1700a50d3b6f915a4
Diffstat (limited to 'vcl/quartz')
-rw-r--r-- | vcl/quartz/ctfonts.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index 20fba1f90f21..c1116131403a 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -167,7 +167,11 @@ bool CoreTextStyle::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) SAL_WNODEPRECATED_DECLARATIONS_PUSH //TODO: 10.11 kCTFontDefaultOrientation const CTFontOrientation aFontOrientation = kCTFontDefaultOrientation; // TODO: horz/vert SAL_WNODEPRECATED_DECLARATIONS_POP - const CGRect aCGRect = CTFontGetBoundingRectsForGlyphs( aCTFontRef, aFontOrientation, &nCGGlyph, nullptr, 1 ); + CGRect aCGRect = CTFontGetBoundingRectsForGlyphs(aCTFontRef, aFontOrientation, &nCGGlyph, nullptr, 1); + + // Apply font rotation to non-upright glyphs. + if (mfFontRotation && !(aGlyphId & GF_ROTMASK)) + aCGRect = CGRectApplyAffineTransform(aCGRect, CGAffineTransformMakeRotation(mfFontRotation)); rRect.Left() = lrint( aCGRect.origin.x ); rRect.Top() = lrint(-aCGRect.origin.y ); |