Aric Stewart : usp10: Add currency scripts to match windows.

Alexandre Julliard julliard at winehq.org
Fri Dec 23 13:03:22 CST 2011


Module: wine
Branch: master
Commit: 91e0f56c05dcff14d3c16d2b7c4b88babffb6fbb
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=91e0f56c05dcff14d3c16d2b7c4b88babffb6fbb

Author: Aric Stewart <aric at codeweavers.com>
Date:   Thu Dec 22 13:05:11 2011 -0600

usp10: Add currency scripts to match windows.

---

 dlls/usp10/shape.c          |    3 +++
 dlls/usp10/usp10.c          |   27 ++++++++++++++++++++++++++-
 dlls/usp10/usp10_internal.h |    4 ++++
 3 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c
index 7f23296..91f706b 100644
--- a/dlls/usp10/shape.c
+++ b/dlls/usp10/shape.c
@@ -715,6 +715,9 @@ static const ScriptShapeData ShapingData[] =
     {{ no_features, 0}, NULL, "osma", "", NULL, NULL},
     {{ no_features, 0}, NULL, "osma", "", NULL, NULL},
     {{ no_features, 0}, NULL, "math", "", NULL, NULL},
+    {{ hebrew_features, 1}, NULL, "hebr", "", NULL, NULL},
+    {{ latin_features, 2}, NULL, "latn" , "", NULL, NULL},
+    {{ thai_features, 1}, NULL, "thai", "", NULL, ShapeCharGlyphProp_Thai},
 };
 
 static INT GSUB_is_glyph_covered(LPCVOID table , UINT glyph)
diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c
index 14674a7..2e2efb5 100644
--- a/dlls/usp10/usp10.c
+++ b/dlls/usp10/usp10.c
@@ -624,6 +624,18 @@ static const scriptData scriptInformation[] = {
      {0, 0, 1, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 0, 0, 0, 0, 0, 0},
      MS_MAKE_TAG('m','a','t','h'),
      {'C','a','m','b','r','i','a',' ','M','a','t','h'}},
+    {{Script_Hebrew_Currency, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}},
+     {LANG_HEBREW, 0, 1, 0, 0, HEBREW_CHARSET, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+     MS_MAKE_TAG('h','e','b','r'),
+     {'M','i','c','r','o','s','o','f','t',' ','S','a','n','s',' ','S','e','r','i','f',0}},
+    {{Script_Vietnamese_Currency, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}},
+     {LANG_VIETNAMESE, 0, 0, 0, 0, VIETNAMESE_CHARSET, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+     MS_MAKE_TAG('l','a','t','n'),
+     {0}},
+    {{Script_Thai_Currency, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}},
+     {LANG_THAI, 0, 1, 0, 0, THAI_CHARSET, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+     MS_MAKE_TAG('t','h','a','i'),
+     {'M','i','c','r','o','s','o','f','t',' ','S','a','n','s',' ','S','e','r','i','f',0}},
 };
 
 static const SCRIPT_PROPERTIES *script_props[] =
@@ -667,7 +679,8 @@ static const SCRIPT_PROPERTIES *script_props[] =
     &scriptInformation[72].props, &scriptInformation[73].props,
     &scriptInformation[74].props, &scriptInformation[75].props,
     &scriptInformation[76].props, &scriptInformation[77].props,
-    &scriptInformation[78].props
+    &scriptInformation[78].props, &scriptInformation[79].props,
+    &scriptInformation[80].props, &scriptInformation[81].props
 };
 
 typedef struct {
@@ -830,6 +843,18 @@ static WORD get_char_script( LPCWSTR str, INT index, INT end, INT *consumed)
     if (str[index] == 0x2212 || str[index] == 0x2044)
         return Script_Punctuation;
 
+    /* Currency Symboles by Unicode point */
+    switch (str[index])
+    {
+        case 0x09f2:
+        case 0x09f3: return Script_Bengali_Currency;
+        case 0x0af1: return Script_Gujarati_Currency;
+        case 0x0e3f: return Script_Thai_Currency;
+        case 0x20aa: return Script_Hebrew_Currency;
+        case 0x20ab: return Script_Vietnamese_Currency;
+        case 0xfb29: return Script_Hebrew_Currency;
+    }
+
     GetStringTypeW(CT_CTYPE1, &str[index], 1, &type);
 
     if (type == 0)
diff --git a/dlls/usp10/usp10_internal.h b/dlls/usp10/usp10_internal.h
index 559a0bc..fb98377 100644
--- a/dlls/usp10/usp10_internal.h
+++ b/dlls/usp10/usp10_internal.h
@@ -115,6 +115,10 @@
 #define Script_Osmanya_Numeric 77
 /* Unicode Chapter 15 : Plane 1 */
 #define Script_MathAlpha 78
+/* Additional Currency Scripts */
+#define Script_Hebrew_Currency 79
+#define Script_Vietnamese_Currency 80
+#define Script_Thai_Currency 81
 
 #define GLYPH_BLOCK_SHIFT 8
 #define GLYPH_BLOCK_SIZE  (1UL << GLYPH_BLOCK_SHIFT)




More information about the wine-cvs mailing list