Aric Stewart : usp10: Strip dangling joiners for Sinhala.
Alexandre Julliard
julliard at winehq.org
Thu Jun 9 11:47:39 CDT 2011
Module: wine
Branch: master
Commit: 0f795650f811d6f27557655c3ab8001fc20f6780
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0f795650f811d6f27557655c3ab8001fc20f6780
Author: Aric Stewart <aric at codeweavers.com>
Date: Wed Jun 8 14:05:22 2011 -0500
usp10: Strip dangling joiners for Sinhala.
---
dlls/usp10/shape.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c
index f64dbd7..03d97f4 100644
--- a/dlls/usp10/shape.c
+++ b/dlls/usp10/shape.c
@@ -2036,6 +2036,7 @@ static const VowelComponents Sinhala_vowels[] = {
static void ContextualShape_Sinhala(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR* pwcChars, INT cChars, WORD* pwOutGlyphs, INT* pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust)
{
int cCount = cChars;
+ int i;
WCHAR *input;
if (*pcGlyphs != cChars)
@@ -2057,7 +2058,15 @@ static void ContextualShape_Sinhala(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *
Indic_ReorderCharacters( input, cCount, sinhala_lex, Reorder_Like_Sinhala);
TRACE("reordered string %s\n",debugstr_wn(input,cCount));
- /* Step 3: Get glyphs */
+ /* Step 3: Strip dangling joiners */
+ for (i = 0; i < cCount; i++)
+ {
+ if ((input[i] == 0x200D || input[i] == 0x200C) &&
+ (i == 0 || input[i-1] == 0x0020 || i == cCount-1 || input[i+1] == 0x0020))
+ input[i] = 0x0020;
+ }
+
+ /* Step 4: Get glyphs */
GetGlyphIndicesW(hdc, input, cCount, pwOutGlyphs, 0);
*pcGlyphs = cCount;
More information about the wine-cvs
mailing list