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>
This commit is contained in:
Mark Hung
2017-11-17 22:34:00 +01:00
parent 0b31768cb1
commit 58af692e28
+7
View File
@@ -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;