summaryrefslogtreecommitdiff
path: root/vcl/quartz/ctfonts.cxx
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2019-08-28 17:24:51 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2019-09-11 11:39:26 +0200
commita4d509179c5fecf2e6e0c2f1dec1b6979297c516 (patch)
tree692c12d8eb0c9b3562f57995de5326e931b63d79 /vcl/quartz/ctfonts.cxx
parent735af14843eab3e75ac9ed6f0773ce7bb3241c8a (diff)
Move creating HarfBuzz face to PhysicalFontFace
The two map to each other; there are many size-specific LogicalFontInstance's in each PhysicalFontFace, and the same goes for hb_face_t and hb_font_t. This will make it possible to access HarfBuzz face from PhysicalFontFace in the future. Change-Id: I029ad8c4b619b55a2c629f813b9e60bda29b1c08
Diffstat (limited to 'vcl/quartz/ctfonts.cxx')
-rw-r--r--vcl/quartz/ctfonts.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 252720a0aa4e..4bb749a7d11a 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -232,16 +232,15 @@ bool CoreTextStyle::GetGlyphOutline(sal_GlyphId nId, basegfx::B2DPolyPolygon& rR
return true;
}
-static hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData)
+hb_blob_t* CoreTextFontFace::GetHbTable(hb_tag_t nTag) const
{
sal_uLong nLength = 0;
unsigned char* pBuffer = nullptr;
- CoreTextFontFace* pFont = static_cast<CoreTextFontFace*>(pUserData);
- nLength = pFont->GetFontTable(nTableTag, nullptr);
+ nLength = GetFontTable(nTag, nullptr);
if (nLength > 0)
{
pBuffer = new unsigned char[nLength];
- pFont->GetFontTable(nTableTag, pBuffer);
+ GetFontTable(nTag, pBuffer);
}
hb_blob_t* pBlob = nullptr;
@@ -253,9 +252,7 @@ static hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pU
hb_font_t* CoreTextStyle::ImplInitHbFont()
{
- hb_face_t* pHbFace = hb_face_create_for_tables(getFontTable, const_cast<PhysicalFontFace*>(GetFontFace()), nullptr);
-
- return InitHbFont(pHbFace);
+ return InitHbFont(GetFontFace()->GetHbFace());
}
rtl::Reference<LogicalFontInstance> CoreTextFontFace::CreateFontInstance(const FontSelectPattern& rFSD) const