Commit 61e82e2c authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

usp10: Properly adjust LogClust when decomposing indic vowels.

parent db03d645
......@@ -1783,10 +1783,11 @@ static void ReplaceInsertChars(HDC hdc, INT cWalk, INT* pcChars, WCHAR *pwOutCha
}
}
static void DecomposeVowels(HDC hdc, WCHAR *pwOutChars, INT *pcChars, const VowelComponents vowels[])
static void DecomposeVowels(HDC hdc, WCHAR *pwOutChars, INT *pcChars, const VowelComponents vowels[], WORD* pwLogClust)
{
int i;
int cWalk;
int offset = 0;
for (cWalk = 0; cWalk < *pcChars; cWalk++)
{
......@@ -1794,9 +1795,14 @@ static void DecomposeVowels(HDC hdc, WCHAR *pwOutChars, INT *pcChars, const Vowe
{
if (pwOutChars[cWalk] == vowels[i].base)
{
int j;
int o = 1;
ReplaceInsertChars(hdc, cWalk, pcChars, pwOutChars, vowels[i].parts);
if (vowels[i].parts[1]) cWalk++;
if (vowels[i].parts[2]) cWalk++;
if (vowels[i].parts[1]) { cWalk++; o++; }
if (vowels[i].parts[2]) { cWalk++; o++; }
offset += o;
for (j = (cWalk - offset) + 1; j < *pcChars - offset; j ++)
pwLogClust[j]+=o;
break;
}
}
......@@ -2404,7 +2410,7 @@ static void ContextualShape_Sinhala(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *
memcpy(input, pwcChars, cChars * sizeof(WCHAR));
/* Step 1: Decompose multi part vowels */
DecomposeVowels(hdc, input, &cCount, Sinhala_vowels);
DecomposeVowels(hdc, input, &cCount, Sinhala_vowels, pwLogClust);
TRACE("New double vowel expanded string %s (%i)\n",debugstr_wn(input,cCount),cCount);
......@@ -2526,7 +2532,7 @@ static void ContextualShape_Bengali(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *
memcpy(input, pwcChars, cChars * sizeof(WCHAR));
/* Step 1: Decompose Vowels and Compose Consonents */
DecomposeVowels(hdc, input, &cCount, Bengali_vowels);
DecomposeVowels(hdc, input, &cCount, Bengali_vowels, pwLogClust);
ComposeConsonants(hdc, input, &cCount, Bengali_consonants, pwLogClust);
TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
......@@ -2683,7 +2689,7 @@ static void ContextualShape_Oriya(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *ps
memcpy(input, pwcChars, cChars * sizeof(WCHAR));
/* Step 1: Decompose Vowels and Compose Consonents */
DecomposeVowels(hdc, input, &cCount, Oriya_vowels);
DecomposeVowels(hdc, input, &cCount, Oriya_vowels, pwLogClust);
ComposeConsonants(hdc, input, &cCount, Oriya_consonants, pwLogClust);
TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
......@@ -2733,7 +2739,7 @@ static void ContextualShape_Tamil(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *ps
memcpy(input, pwcChars, cChars * sizeof(WCHAR));
/* Step 1: Decompose Vowels and Compose Consonents */
DecomposeVowels(hdc, input, &cCount, Tamil_vowels);
DecomposeVowels(hdc, input, &cCount, Tamil_vowels, pwLogClust);
ComposeConsonants(hdc, input, &cCount, Tamil_consonants, pwLogClust);
TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
......@@ -2783,7 +2789,7 @@ static void ContextualShape_Telugu(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *p
memcpy(input, pwcChars, cChars * sizeof(WCHAR));
/* Step 1: Decompose Vowels */
DecomposeVowels(hdc, input, &cCount, Telugu_vowels);
DecomposeVowels(hdc, input, &cCount, Telugu_vowels, pwLogClust);
TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
/* Step 2: Reorder within Syllables */
......@@ -2835,7 +2841,7 @@ static void ContextualShape_Kannada(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *
memcpy(input, pwcChars, cChars * sizeof(WCHAR));
/* Step 1: Decompose Vowels */
DecomposeVowels(hdc, input, &cCount, Kannada_vowels);
DecomposeVowels(hdc, input, &cCount, Kannada_vowels, pwLogClust);
TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
/* Step 2: Reorder within Syllables */
......@@ -2880,7 +2886,7 @@ static void ContextualShape_Malayalam(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS
memcpy(input, pwcChars, cChars * sizeof(WCHAR));
/* Step 1: Decompose Vowels */
DecomposeVowels(hdc, input, &cCount, Malayalam_vowels);
DecomposeVowels(hdc, input, &cCount, Malayalam_vowels, pwLogClust);
TRACE("New composed string %s (%i)\n",debugstr_wn(input,cCount),cCount);
/* Step 2: Reorder within Syllables */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment