diff options
author | Khaled Hosny <khaled@aliftype.com> | 2022-09-03 03:14:08 +0200 |
---|---|---|
committer | خالد حسني <khaled@aliftype.com> | 2022-09-04 02:10:17 +0200 |
commit | dc92a4d973086ce8a6a5f75ba0f4d4c9ca05537a (patch) | |
tree | 9380a4db2bb8ee1ea131b62c6cfab2957ccd5fef /vcl/quartz | |
parent | b87f4dfd33b48bb2f6cec9732ace51f2a272308d (diff) |
vcl: Create hb_face_t in PhysicalFontFace
The two map to each other, and we want to access hb_face_t to provide
some functionality scattered currently in platform-specific
implementations.
Change-Id: Ib3842752ec240b8254db828dba95a6a0ad65f16a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139275
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@aliftype.com>
Diffstat (limited to 'vcl/quartz')
-rw-r--r-- | vcl/quartz/ctfonts.cxx | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index e5db219c3f8d..5e3e014c3cd4 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; @@ -293,13 +292,9 @@ void CoreTextStyle::SetFontVariationsOnHBFont(hb_font_t* pHbFont) const hb_font_set_variations(pHbFont, aHBVariations.data(), aHBVariations.size()); } -hb_font_t* CoreTextStyle::ImplInitHbFont() +void CoreTextStyle::ImplInitHbFont(hb_font_t* pHbFont) { - hb_face_t* pHbFace = hb_face_create_for_tables(getFontTable, GetFontFace(), nullptr); - hb_font_t* pHBFont = InitHbFont(pHbFace); - SetFontVariationsOnHBFont(pHBFont); - - return pHBFont; + SetFontVariationsOnHBFont(pHbFont); } rtl::Reference<LogicalFontInstance> CoreTextFontFace::CreateFontInstance(const vcl::font::FontSelectPattern& rFSD) const |