summaryrefslogtreecommitdiff
path: root/vcl/quartz
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2019-08-25 14:12:15 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2019-08-27 20:38:19 +0200
commit60d4be99383b6fe13ca55572c43fd022bdc73ce8 (patch)
tree356ce7bd448e3f93a59f9c47e108b87c5ac58838 /vcl/quartz
parenta5cafe5d7e87c0f5ecdcffbbe58c66abcb97ac8e (diff)
Consolidate ImplCalcLineSpacing()
Move getting UPEM and font tables to the functions and use HarfBuzz API to get them. In the future we might stop reading the tables ourselves and use HarfBuzz metrics API instead. Change-Id: I3f4511628fd33200bae94cdcd96479ba3e6d2fba Reviewed-on: https://gerrit.libreoffice.org/78081 Tested-by: Jenkins Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Diffstat (limited to 'vcl/quartz')
-rw-r--r--vcl/quartz/ctfonts.cxx18
1 files changed, 1 insertions, 17 deletions
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 06a25965653f..252720a0aa4e 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -110,24 +110,8 @@ 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?
CTFontRef aCTFontRef = static_cast<CTFontRef>(CFDictionaryGetValue( mpStyleDict, kCTFontAttributeName ));
- const CoreTextFontFace* mpFontData = static_cast<const CoreTextFontFace*>(GetFontFace());
- int nBufSize = 0;
-
- nBufSize = mpFontData->GetFontTable("hhea", nullptr);
- uint8_t* pHheaBuf = new uint8_t[nBufSize];
- nBufSize = mpFontData->GetFontTable("hhea", pHheaBuf);
- std::vector<uint8_t> rHhea(pHheaBuf, pHheaBuf + nBufSize);
-
- nBufSize = mpFontData->GetFontTable("OS/2", nullptr);
- uint8_t* pOS2Buf = new uint8_t[nBufSize];
- nBufSize = mpFontData->GetFontTable("OS/2", pOS2Buf);
- std::vector<uint8_t> rOS2(pOS2Buf, pOS2Buf + nBufSize);
-
- rxFontMetric->ImplCalcLineSpacing(rHhea, rOS2, CTFontGetUnitsPerEm(aCTFontRef));
-
- delete[] pHheaBuf;
- delete[] pOS2Buf;
+ rxFontMetric->ImplCalcLineSpacing(this);
// since ImplFontMetricData::mnWidth is only used for stretching/squeezing fonts
// setting this width to the pixel height of the fontsize is good enough