From 3d56d674aa32e9b8f092695190315652fdb94950 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Tue, 21 Jun 2011 10:07:53 -0500 Subject: [PATCH] usp10: Correct ralf glyph offset calculation in PostBase. --- dlls/usp10/shape.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index 104757c74ff..e0b32c9ff83 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -2096,19 +2096,21 @@ static inline INT find_halant_consonant(WCHAR* pwChars, INT index, INT end, lexi static void Apply_Indic_PostBase(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR* pwChars, INT cChars, IndicSyllable *syllable, WORD *pwOutGlyphs, INT* pcGlyphs, WORD *pwLogClust, lexical_function lexical, IndicSyllable *glyph_index, const char* feat) { INT index, nextIndex; - INT count, g_offset; + INT count, g_offset=0; + INT ralf = syllable->ralf; count = syllable->end - syllable->base; - if (syllable->ralf >= syllable->base) - g_offset = -1; - else - g_offset = 0; index = find_halant_consonant(&pwChars[syllable->base], 0, count, lexical); while (index >= 0) { INT prevCount = *pcGlyphs; + if (ralf >=0 && ralf < index) + { + g_offset--; + ralf = -1; + } nextIndex = apply_GSUB_feature_to_glyph(hdc, psa, psc, pwOutGlyphs, index+glyph_index->base+g_offset, 1, pcGlyphs, feat); if (nextIndex > GSUB_E_NOGLYPH) {