summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaled@aliftype.com>2022-11-19 21:11:22 +0200
committerخالد حسني <khaled@aliftype.com>2022-11-20 22:17:50 +0100
commit1f9b2a7057a519e0ea750875ac439129f1d3df87 (patch)
treebb2bec55a97971c5af0b0f1602ee5b79410895e5
parentd4005521e4fe4379381605b63af1950c5aecd798 (diff)
vcl: fix glyph positioning for artificial italic
Let HarfBuzz transform the glyph positions as well, so that e.g. combining marks get shifted relative to their slanted base glyphs. Change-Id: Ib399ab462b36effdc21c4bbeba79d65214792f9c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142979 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@aliftype.com>
-rw-r--r--vcl/source/font/LogicalFontInstance.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/vcl/source/font/LogicalFontInstance.cxx b/vcl/source/font/LogicalFontInstance.cxx
index d07a8eb9c974..34f05bbe6e33 100644
--- a/vcl/source/font/LogicalFontInstance.cxx
+++ b/vcl/source/font/LogicalFontInstance.cxx
@@ -67,6 +67,13 @@ hb_font_t* LogicalFontInstance::InitHbFont()
if (!aVariations.empty())
hb_font_set_variations(pHbFont, aVariations.data(), aVariations.size());
+#if HB_VERSION_ATLEAST(3, 3, 0)
+ // If we are applying artificial italic, instruct HarfBuzz to do the same
+ // so that mark positioning is also transformed.
+ if (NeedsArtificialItalic())
+ hb_font_set_synthetic_slant(pHbFont, ARTIFICIAL_ITALIC_SKEW);
+#endif
+
ImplInitHbFont(pHbFont);
return pHbFont;