usp10: Properly adjust LogClust when decomposing indic vowels.

This commit is contained in:
Aric Stewart 2011-10-17 20:47:23 -05:00 committed by Alexandre Julliard
parent db03d6452d
commit 61e82e2c8c
1 changed files with 16 additions and 10 deletions

View File

@ -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 */