summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2017-11-10 00:24:26 +0800
committerMark Hung <marklh9@gmail.com>2017-11-17 22:34:00 +0100
commit58af692e28146a1ecb4fbeef89e839baa1a1b39d (patch)
treedce928c66f5d8086cca50702e9810bdcd096cc3e /vcl/source
parent0b31768cb1b3d409cea3dafc5b1f8d5d11333e81 (diff)
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 positionos 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@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/gdi/CommonSalLayout.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx
index 9b2d7e492a29..08842283f908 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -734,6 +734,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;