Aric Stewart : usp10: Add Yi script.

Alexandre Julliard julliard at winehq.org
Tue Dec 13 13:01:26 CST 2011


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

Author: Aric Stewart <aric at codeweavers.com>
Date:   Mon Dec 12 14:50:40 2011 -0600

usp10: Add Yi script.

---

 dlls/usp10/shape.c          |    1 +
 dlls/usp10/tests/usp10.c    |   10 ++++++++++
 dlls/usp10/usp10.c          |    8 +++++++-
 dlls/usp10/usp10_internal.h |    1 +
 4 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c
index bc53bba..4b399d7 100644
--- a/dlls/usp10/shape.c
+++ b/dlls/usp10/shape.c
@@ -644,6 +644,7 @@ static const ScriptShapeData ShapingData[] =
     {{ no_features, 0}, NULL, "bopo", "", NULL, NULL},
     {{ no_features, 0}, NULL, "kana", "", NULL, NULL},
     {{ no_features, 0}, NULL, "hang", "", NULL, NULL},
+    {{ no_features, 0}, NULL, "yi  ", "", NULL, NULL},
 };
 
 static INT GSUB_is_glyph_covered(LPCVOID table , UINT glyph)
diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c
index 83ea749..b2538f8 100644
--- a/dlls/usp10/tests/usp10.c
+++ b/dlls/usp10/tests/usp10.c
@@ -157,6 +157,7 @@ static inline void _test_items_ok(LPCWSTR string, DWORD cchString,
 #define bopo_tag MS_MAKE_TAG('b','o','p','o')
 #define kana_tag MS_MAKE_TAG('k','a','n','a')
 #define hang_tag MS_MAKE_TAG('h','a','n','g')
+#define yi_tag MS_MAKE_TAG('y','i',' ',' ')
 
 static void test_ScriptItemize( void )
 {
@@ -351,6 +352,11 @@ static void test_ScriptItemize( void )
     static const itemTest t321[2] = {{{0,0,0,0,0},0,0,0,0,hang_tag,FALSE},{{0,0,0,0,0},3,0,0,0,-1,FALSE}};
     static const itemTest t322[2] = {{{0,0,0,0,0},0,0,0,2,hang_tag,FALSE},{{0,0,0,0,0},3,0,0,0,-1,FALSE}};
 
+    /* Yi */
+    static const WCHAR test33[] = {0xa188,0xa320,0xa071,0xa0b7};
+    static const itemTest t331[2] = {{{0,0,0,0,0},0,0,0,0,yi_tag,FALSE},{{0,0,0,0,0},4,0,0,0,-1,FALSE}};
+    static const itemTest t332[2] = {{{0,0,0,0,0},0,0,0,2,yi_tag,FALSE},{{0,0,0,0,0},4,0,0,0,-1,FALSE}};
+
     SCRIPT_ITEM items[15];
     SCRIPT_CONTROL  Control;
     SCRIPT_STATE    State;
@@ -416,6 +422,7 @@ static void test_ScriptItemize( void )
     test_items_ok(test30,8,NULL,NULL,1,t301,FALSE,0);
     test_items_ok(test31,8,NULL,NULL,1,t311,FALSE,2);
     test_items_ok(test32,3,NULL,NULL,1,t321,FALSE,0);
+    test_items_ok(test33,4,NULL,NULL,1,t331,FALSE,0);
 
     State.uBidiLevel = 0;
     test_items_ok(test1,4,&Control,&State,1,t11,FALSE,0);
@@ -455,6 +462,7 @@ static void test_ScriptItemize( void )
     test_items_ok(test30,8,&Control,&State,1,t301,FALSE,0);
     test_items_ok(test31,8,&Control,&State,1,t311,FALSE,2);
     test_items_ok(test32,3,&Control,&State,1,t321,FALSE,0);
+    test_items_ok(test33,4,&Control,&State,1,t331,FALSE,0);
 
     State.uBidiLevel = 1;
     test_items_ok(test1,4,&Control,&State,1,t12,FALSE,0);
@@ -494,6 +502,7 @@ static void test_ScriptItemize( void )
     test_items_ok(test30,8,&Control,&State,1,t302,FALSE,0);
     test_items_ok(test31,8,&Control,&State,1,t312,FALSE,2);
     test_items_ok(test32,3,&Control,&State,1,t322,FALSE,0);
+    test_items_ok(test33,4,&Control,&State,1,t332,FALSE,0);
 
     State.uBidiLevel = 1;
     Control.fMergeNeutralItems = TRUE;
@@ -534,6 +543,7 @@ static void test_ScriptItemize( void )
     test_items_ok(test30,8,&Control,&State,1,t302,FALSE,0);
     test_items_ok(test31,8,&Control,&State,1,t312,FALSE,2);
     test_items_ok(test32,3,&Control,&State,1,t322,FALSE,0);
+    test_items_ok(test33,4,&Control,&State,1,t332,FALSE,0);
 }
 
 static inline void _test_shape_ok(int valid, HDC hdc, LPCWSTR string,
diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c
index dcd4477..71888db 100644
--- a/dlls/usp10/usp10.c
+++ b/dlls/usp10/usp10.c
@@ -214,6 +214,8 @@ static const scriptRange scriptRanges[] = {
     { Script_CJK_Han    ,0x3400, 0x4dbf,  0, 0},
     /* CJK Unified Ideographs: U+4E00–U+9FFF */
     { Script_CJK_Han    ,0x4e00, 0x9fff,  0, 0},
+    /* Yi: U+A000–U+A4CF */
+    { Script_Yi         ,0xa000, 0xa4cf,  0, 0},
     /* Cyrillic Extended-B: U+A640–U+A69F */
     { Script_Cyrillic,   0xa640, 0xa69f,  0, 0},
     /* Modifier Tone Letters: U+A700–U+A71F */
@@ -503,6 +505,10 @@ static const scriptData scriptInformation[] = {
      {LANG_KOREAN, 0, 1, 0, 1, DEFAULT_CHARSET, 0, 0, 0, 0, 0, 0, 1, 0, 0},
      MS_MAKE_TAG('h','a','n','g'),
      {0}},
+    {{Script_Yi, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}},
+     {LANG_ENGLISH, 0, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 0, 0, 0, 1, 0, 0},
+     MS_MAKE_TAG('y','i',' ',' '),
+     {'M','i','c','r','o','s','o','f','t',' ','Y','i',' ','B','a','i','t','i'}},
 };
 
 static const SCRIPT_PROPERTIES *script_props[] =
@@ -536,7 +542,7 @@ static const SCRIPT_PROPERTIES *script_props[] =
     &scriptInformation[52].props, &scriptInformation[53].props,
     &scriptInformation[54].props, &scriptInformation[55].props,
     &scriptInformation[56].props, &scriptInformation[57].props,
-    &scriptInformation[58].props
+    &scriptInformation[58].props, &scriptInformation[59].props
 };
 
 typedef struct {
diff --git a/dlls/usp10/usp10_internal.h b/dlls/usp10/usp10_internal.h
index 3ee06cb..563323e 100644
--- a/dlls/usp10/usp10_internal.h
+++ b/dlls/usp10/usp10_internal.h
@@ -89,6 +89,7 @@
 #define Script_Bopomofo 56
 #define Script_Kana 57
 #define Script_Hangul 58
+#define Script_Yi 59
 
 #define GLYPH_BLOCK_SHIFT 8
 #define GLYPH_BLOCK_SIZE  (1UL << GLYPH_BLOCK_SHIFT)




More information about the wine-cvs mailing list