Module: wine Branch: master Commit: 61e82e2c8ccf86e198520577b0000d0bcef4c0b6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=61e82e2c8ccf86e198520577b0...
Author: Aric Stewart aric@codeweavers.com Date: Mon Oct 17 20:47:23 2011 -0500
usp10: Properly adjust LogClust when decomposing indic vowels.
---
dlls/usp10/shape.c | 26 ++++++++++++++++---------- 1 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index 4951c22..0b1af46 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -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 */