Module: wine Branch: master Commit: 14f42cdcbcfa4afe70309982012250e05618ef70 URL: http://source.winehq.org/git/wine.git/?a=commit;h=14f42cdcbcfa4afe7030998201...
Author: Aric Stewart aric@codeweavers.com Date: Mon Jun 4 07:44:09 2012 -0500
usp10: Insert dotted circle (U+25CC) for invalid combining sequences in Thaana.
---
dlls/usp10/shape.c | 41 ++++++++++++++++++++++++++++++++++++++++- 1 files changed, 40 insertions(+), 1 deletions(-)
diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index cf137bb..6592cda 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -44,6 +44,7 @@ typedef VOID (*ContextualShapingProc)(HDC, ScriptCache*, SCRIPT_ANALYSIS*, static void ContextualShape_Arabic(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR* pwcChars, INT cChars, WORD* pwOutGlyphs, INT* pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust); static void ContextualShape_Hebrew(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR* pwcChars, INT cChars, WORD* pwOutGlyphs, INT* pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust); static void ContextualShape_Syriac(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR* pwcChars, INT cChars, WORD* pwOutGlyphs, INT* pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust); +static void ContextualShape_Thaana(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR* pwcChars, INT cChars, WORD* pwOutGlyphs, INT* pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust); static void ContextualShape_Phags_pa(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR* pwcChars, INT cChars, WORD* pwOutGlyphs, INT* pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust); static void ContextualShape_Sinhala(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR* pwcChars, INT cChars, WORD* pwOutGlyphs, INT* pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust); static void ContextualShape_Devanagari(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR* pwcChars, INT cChars, WORD* pwOutGlyphs, INT* pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust); @@ -398,7 +399,7 @@ static const ScriptShapeData ShapingData[] = {{ hebrew_features, 1}, NULL, 0, ContextualShape_Hebrew, NULL}, {{ syriac_features, 4}, required_syriac_features, 0, ContextualShape_Syriac, ShapeCharGlyphProp_None}, {{ arabic_features, 6}, required_arabic_features, 0, ContextualShape_Arabic, ShapeCharGlyphProp_Arabic}, - {{ NULL, 0}, NULL, 0, NULL, ShapeCharGlyphProp_None}, + {{ NULL, 0}, NULL, 0, ContextualShape_Thaana, ShapeCharGlyphProp_None}, {{ standard_features, 2}, NULL, 0, NULL, NULL}, {{ standard_features, 2}, NULL, 0, NULL, NULL}, {{ standard_features, 2}, NULL, 0, NULL, NULL}, @@ -1241,6 +1242,44 @@ right_join_causing(neighbour_joining_type(i,dirR,context_type,cChars,psa))) mark_invalid_combinations(hdc, pwcChars, cChars, pwOutGlyphs, pcGlyphs, dirL, pwLogClust, combining_lexical_Syriac); }
+static int combining_lexical_Thaana(WCHAR c) +{ + enum {Thaana_Norm=0, Thaana_FILI}; + + switch(c) + { + case 0x7A6: + case 0x7A7: + case 0x7A8: + case 0x7A9: + case 0x7AA: + case 0x7AB: + case 0x7AC: + case 0x7AD: + case 0x7AE: + case 0x7AF: return Thaana_FILI; break; + default: return Thaana_Norm; + } +} + +static void ContextualShape_Thaana(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR* pwcChars, INT cChars, WORD* pwOutGlyphs, INT* pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust) +{ + INT dirL; + + if (*pcGlyphs != cChars) + { + ERR("Number of Glyphs and Chars need to match at the beginning\n"); + return; + } + + if (!psa->fLogicalOrder && psa->fRTL) + dirL = -1; + else + dirL = 1; + + mark_invalid_combinations(hdc, pwcChars, cChars, pwOutGlyphs, pcGlyphs, dirL, pwLogClust, combining_lexical_Thaana); +} + /* * ContextualShape_Phags_pa */