diff options
author | Khaled Hosny <khaled@libreoffice.org> | 2023-07-16 07:37:55 +0300 |
---|---|---|
committer | خالد حسني <khaled@libreoffice.org> | 2023-07-23 06:00:30 +0200 |
commit | dfe42e756b37642355356a6035081f4473609832 (patch) | |
tree | 77a42535ddef1f76802fa4221f33fd97755bb2ff /vcl/quartz | |
parent | 32144b5dc617d5a375eeadf25b5b62befb529785 (diff) |
vcl: Use HarfBuzz to get glyph bounding rectangle
For consistent cross-platform results that also matches our glyph
advances since platform functions might be using hints which we don’t
use.
Change-Id: I4aebd3e7c5f460dff584f5eba74f7a11bab0f9b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154388
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Diffstat (limited to 'vcl/quartz')
-rw-r--r-- | vcl/quartz/ctfonts.cxx | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index 2d9b7c896781..3d3298f6f50f 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -89,27 +89,6 @@ void CoreTextFont::GetFontMetric( FontMetricDataRef const & rxFontMetric ) rxFontMetric->SetMinKashida(GetKashidaWidth()); } -bool CoreTextFont::ImplGetGlyphBoundRect(sal_GlyphId nId, tools::Rectangle& rRect, bool bVertical) const -{ - CGGlyph nCGGlyph = nId; - - SAL_WNODEPRECATED_DECLARATIONS_PUSH //TODO: 10.11 kCTFontDefaultOrientation - const CTFontOrientation aFontOrientation = kCTFontDefaultOrientation; // TODO: horz/vert - SAL_WNODEPRECATED_DECLARATIONS_POP - CGRect aCGRect = CTFontGetBoundingRectsForGlyphs(mpCTFont, aFontOrientation, &nCGGlyph, nullptr, 1); - - // Apply font rotation to non-vertical glyphs. - if (mfFontRotation && !bVertical) - aCGRect = CGRectApplyAffineTransform(aCGRect, CGAffineTransformMakeRotation(mfFontRotation)); - - tools::Long xMin = floor(aCGRect.origin.x); - tools::Long yMin = floor(aCGRect.origin.y); - tools::Long xMax = ceil(aCGRect.origin.x + aCGRect.size.width); - tools::Long yMax = ceil(aCGRect.origin.y + aCGRect.size.height); - rRect = tools::Rectangle(xMin, -yMax, xMax, -yMin); - return true; -} - namespace { // callbacks from CTFontCreatePathForGlyph+CGPathApply for GetGlyphOutline() |