summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorKhaled Hosny <khaled@aliftype.com>2022-10-29 20:17:35 +0200
committerخالد حسني <khaled@aliftype.com>2022-11-02 23:06:46 +0100
commit643fec7cf7a81bf8c89a8efd47c0310b38f9076c (patch)
tree95add7bdb619d55d5ca35ca3258d79bcb9af187a /vcl/source
parent29f318f90d2ed72a807d803094734d5ee7322a2d (diff)
vcl: add PhysicalFontFace::GetVariations()
Use it to set the variations on hb_font_t, and we will use it for other things in later commits. Change-Id: Iae1861f74b38af4921ac97c1facecf0d4815c201 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142024 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@aliftype.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/font/LogicalFontInstance.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/vcl/source/font/LogicalFontInstance.cxx b/vcl/source/font/LogicalFontInstance.cxx
index b5d36afb2e56..c3a7c6726537 100644
--- a/vcl/source/font/LogicalFontInstance.cxx
+++ b/vcl/source/font/LogicalFontInstance.cxx
@@ -57,11 +57,18 @@ hb_font_t* LogicalFontInstance::InitHbFont()
auto pFace = GetFontFace();
hb_face_t* pHbFace = pFace->GetHbFace();
assert(pHbFace);
- hb_font_t* pHbFont = hb_font_create(pHbFace);
auto nUPEM = pFace->UnitsPerEm();
+
+ hb_font_t* pHbFont = hb_font_create(pHbFace);
hb_font_set_scale(pHbFont, nUPEM, nUPEM);
hb_ot_font_set_funcs(pHbFont);
+
+ auto aVariations = pFace->GetVariations();
+ if (!aVariations.empty())
+ hb_font_set_variations(pHbFont, aVariations.data(), aVariations.size());
+
ImplInitHbFont(pHbFont);
+
return pHbFont;
}