vcl/source/font/LogicalFontInstance.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 1f9b2a7057a519e0ea750875ac439129f1d3df87
Author:     Khaled Hosny <kha...@aliftype.com>
AuthorDate: Sat Nov 19 21:11:22 2022 +0200
Commit:     خالد حسني <kha...@aliftype.com>
CommitDate: Sun Nov 20 22:17:50 2022 +0100

    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: خالد حسني <kha...@aliftype.com>

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;

Reply via email to