[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - vcl/source

Mark Hung marklh9 at gmail.com
Thu Nov 30 12:21:24 UTC 2017


 vcl/source/gdi/CommonSalLayout.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 2ed722a7a49e9e90480e49e1ef0cec8e8c79b79d
Author: Mark Hung <marklh9 at gmail.com>
Date:   Fri Nov 10 00:24:26 2017 +0800

    tdf#111967 translate offsets so it is relative to v origin
    
    The offsets were 0 in HarfBuzz 1.3.3 but the value became
    something else and made text offsets toward upper-right
    after upgrading to HarfBuzz 1.4.8. Those values are offsets
    relative to the horizontal origin.  But underlying renderer
    expect positions relative to the vertical origin. Translate
    them back by adding the horizontal origin.
    
    Change-Id: If58d2c082b198bfd8789efb3df2be49869a04bf9
    Reviewed-on: https://gerrit.libreoffice.org/44556
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mark Hung <marklh9 at gmail.com>
    (cherry picked from commit 58af692e28146a1ecb4fbeef89e839baa1a1b39d)
    Reviewed-on: https://gerrit.libreoffice.org/45315
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx
index 54a8dc312398..c23293fd6f2b 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -662,6 +662,13 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs)
                 {
                     nGlyphFlags |= GlyphItem::IS_VERTICAL;
 
+                    // We have glyph offsets that is relative to h origin now,
+                    // add the origin back so it is relative to v origin.
+                    hb_font_add_glyph_origin_for_direction( mpHbFont,
+                            nGlyphIndex,
+                            HB_DIRECTION_TTB,
+                            &pHbPositions[i].x_offset ,
+                            &pHbPositions[i].y_offset );
                     nAdvance = -pHbPositions[i].y_advance;
                     nXOffset =  pHbPositions[i].y_offset;
                     nYOffset =  pHbPositions[i].x_offset;


More information about the Libreoffice-commits mailing list