Aric Stewart : usp10: Apply 'ccmp' before Arabic contextual shaping.
Module: wine Branch: master Commit: 0c1419542fa61d6eaacd0a007074cbb3a12605a2 URL: http://source.winehq.org/git/wine.git/?a=commit;h=0c1419542fa61d6eaacd0a0070... Author: Aric Stewart <aric(a)codeweavers.com> Date: Fri Jan 27 11:31:51 2017 -0600 usp10: Apply 'ccmp' before Arabic contextual shaping. Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/usp10/shape.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index 850e929..bf333b2 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -1128,9 +1128,19 @@ static void ContextualShape_Arabic(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *p if (psc->GSUB_Table) { - INT nextIndex; + INT nextIndex, offset = 0; INT prevCount = *pcGlyphs; + /* Apply CCMP first */ + apply_GSUB_feature_to_glyph(hdc, psa, psc, pwOutGlyphs, glyph_index, dirL, pcGlyphs, "ccmp"); + + if (prevCount != *pcGlyphs) + { + offset = *pcGlyphs - prevCount; + if (dirL < 0) + glyph_index -= offset * dirL; + } + /* Apply the contextual feature */ nextIndex = apply_GSUB_feature_to_glyph(hdc, psa, psc, pwOutGlyphs, glyph_index, dirL, pcGlyphs, contextual_features[context_shape[char_index]]); @@ -1138,7 +1148,13 @@ static void ContextualShape_Arabic(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *p { UpdateClusters(glyph_index, *pcGlyphs - prevCount, dirL, cChars, pwLogClust); char_index += dirL; - glyph_index = nextIndex; + if (!offset) + glyph_index = nextIndex; + else + { + offset = *pcGlyphs - prevCount; + glyph_index += dirL * (offset + 1); + } } shaped = (nextIndex > GSUB_E_NOGLYPH); }
participants (1)
-
Alexandre Julliard