Module: wine Branch: master Commit: 6ae41d015c67b58f81264b520b06ccf462eae4ad URL: http://source.winehq.org/git/wine.git/?a=commit;h=6ae41d015c67b58f81264b520b...
Author: Huw Davies huw@codeweavers.com Date: Mon Jan 14 13:17:20 2013 +0000
usp10: Fix MarkToMark offset 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 978c1d2..05b8cab 100644 --- a/dlls/usp10/opentype.c +++ b/dlls/usp10/opentype.c @@ -1758,12 +1758,14 @@ static INT GPOS_apply_lookup(LPOUTLINETEXTMETRICW lpotm, LPLOGFONTW lplogfont, c { double devX, devY; POINT desU = {0,0}; + int write_dir = (analysis->fRTL && !analysis->fLogicalOrder) ? -1 : 1; GPOS_apply_MarkToMark(look, analysis, glyphs, glyph_index, glyph_count, ppem, &desU); if (desU.x || desU.y) { GPOS_convert_design_units_to_device(lpotm, lplogfont, desU.x, desU.y, &devX, &devY); - pGoffset[glyph_index].du += round(devX) + pGoffset[glyph_index-1].du; - pGoffset[glyph_index].dv += round(devY) + pGoffset[glyph_index-1].dv; + if (analysis->fRTL && analysis->fLogicalOrder) devX *= -1; + pGoffset[glyph_index].du += round(devX) + pGoffset[glyph_index - write_dir].du; + pGoffset[glyph_index].dv += round(devY) + pGoffset[glyph_index - write_dir].dv; } break; }