diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2018-05-10 15:46:06 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2018-05-12 02:08:59 +0200 |
commit | 23c5125148a8110d88385b29570bf0b7d4400458 (patch) | |
tree | c28974ca633350e81f8f96375b5b4b439197d735 /vcl/quartz | |
parent | 1a3deaa7f7ff1d7e6ab5f5d551bcbc8c00d84052 (diff) |
Use HarfBuzz to get Kashida width
One less platform-specific piece of code.
Change-Id: Ib04c5f1434046e26ead2aaedace67127a5513e55
Reviewed-on: https://gerrit.libreoffice.org/54098
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Diffstat (limited to 'vcl/quartz')
-rw-r--r-- | vcl/quartz/ctfonts.cxx | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index be615a1ee377..ac20c1e9f4c5 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -104,7 +104,7 @@ CoreTextStyle::~CoreTextStyle() CFRelease( mpStyleDict ); } -void CoreTextStyle::GetFontMetric( ImplFontMetricDataRef const & rxFontMetric ) const +void CoreTextStyle::GetFontMetric( ImplFontMetricDataRef const & rxFontMetric ) { // get the matching CoreText font handle // TODO: is it worth it to cache the CTFontRef in SetFont() and reuse it here? @@ -133,18 +133,7 @@ void CoreTextStyle::GetFontMetric( ImplFontMetricDataRef const & rxFontMetric ) // it also makes the calculation of the stretch factor simple rxFontMetric->SetWidth( lrint( CTFontGetSize( aCTFontRef ) * mfFontStretch) ); - UniChar nKashidaCh = 0x0640; - CGGlyph nKashidaGid = 0; - if (CTFontGetGlyphsForCharacters(aCTFontRef, &nKashidaCh, &nKashidaGid, 1)) - { -SAL_WNODEPRECATED_DECLARATIONS_PUSH - // 'kCTFontHorizontalOrientation' is deprecated: first deprecated in - // macOS 10.11 - double nKashidaAdv = CTFontGetAdvancesForGlyphs(aCTFontRef, - kCTFontHorizontalOrientation, &nKashidaGid, nullptr, 1); -SAL_WNODEPRECATED_DECLARATIONS_POP - rxFontMetric->SetMinKashida(lrint(nKashidaAdv)); - } + rxFontMetric->SetMinKashida(GetKashidaWidth()); } bool CoreTextStyle::GetGlyphBoundRect(const GlyphItem& rGlyph, tools::Rectangle& rRect ) const |