Module: wine Branch: master Commit: 464bf22fdf9840bba3b1b50e1c4c64f2ceaa4595 URL: http://source.winehq.org/git/wine.git/?a=commit;h=464bf22fdf9840bba3b1b50e1c...
Author: Huw Davies huw@codeweavers.com Date: Mon Jan 14 13:17:19 2013 +0000
usp10: Fix pair adjustment for RTL text.
---
dlls/usp10/opentype.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/usp10/opentype.c b/dlls/usp10/opentype.c index d054e32..978c1d2 100644 --- a/dlls/usp10/opentype.c +++ b/dlls/usp10/opentype.c @@ -1699,11 +1699,13 @@ static INT GPOS_apply_lookup(LPOUTLINETEXTMETRICW lpotm, LPLOGFONTW lplogfont, c double devX, devY; int index; int write_dir = (analysis->fRTL && !analysis->fLogicalOrder) ? -1 : 1; + int offset_sign = (analysis->fRTL && analysis->fLogicalOrder) ? -1 : 1; + index = GPOS_apply_PairAdjustment(look, analysis, glyphs, glyph_index, glyph_count, ppem, adjust, advance); if (adjust[0].x || adjust[0].y) { GPOS_convert_design_units_to_device(lpotm, lplogfont, adjust[0].x, adjust[0].y, &devX, &devY); - pGoffset[glyph_index].du += round(devX); + pGoffset[glyph_index].du += round(devX) * offset_sign; pGoffset[glyph_index].dv += round(devY); } if (advance[0].x || advance[0].y) @@ -1714,7 +1716,7 @@ static INT GPOS_apply_lookup(LPOUTLINETEXTMETRICW lpotm, LPLOGFONTW lplogfont, c if (adjust[1].x || adjust[1].y) { GPOS_convert_design_units_to_device(lpotm, lplogfont, adjust[1].x, adjust[1].y, &devX, &devY); - pGoffset[glyph_index + write_dir].du += round(devX); + pGoffset[glyph_index + write_dir].du += round(devX) * offset_sign; pGoffset[glyph_index + write_dir].dv += round(devY); } if (advance[1].x || advance[1].y)