Aric Stewart : usp10: Add Myanmar script.

Alexandre Julliard julliard at winehq.org
Fri Dec 9 14:41:38 CST 2011


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

Author: Aric Stewart <aric at codeweavers.com>
Date:   Fri Dec  9 11:02:30 2011 -0600

usp10: Add Myanmar script.

---

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

diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c
index 7a3df27..675765a 100644
--- a/dlls/usp10/shape.c
+++ b/dlls/usp10/shape.c
@@ -452,6 +452,12 @@ static OPENTYPE_FEATURE_RECORD devanagari_features[] =
     { MS_MAKE_TAG('c','a','l','t'), 1},
 };
 
+static OPENTYPE_FEATURE_RECORD myanmar_features[] =
+{
+    { MS_MAKE_TAG('l','i','g','a'), 1},
+    { MS_MAKE_TAG('c','l','i','g'), 1},
+};
+
 static const char* required_bengali_features[] =
 {
     "nukt",
@@ -598,6 +604,8 @@ static const ScriptShapeData ShapingData[] =
     {{ standard_features, 2}, NULL, "" , "", NULL, NULL},
     {{ latin_features, 2}, NULL, "latn" , "", NULL, NULL},
     {{ standard_features, 2}, NULL, "" , "", NULL, NULL},
+    {{ myanmar_features, 2}, NULL, "mymr", "", NULL, NULL},
+    {{ myanmar_features, 2}, NULL, "mymr", "", 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 dffc6a1..5f47903 100644
--- a/dlls/usp10/tests/usp10.c
+++ b/dlls/usp10/tests/usp10.c
@@ -147,6 +147,7 @@ static inline void _test_items_ok(LPCWSTR string, DWORD cchString,
 #define telu_tag MS_MAKE_TAG('t','e','l','u')
 #define knda_tag MS_MAKE_TAG('k','n','d','a')
 #define mlym_tag MS_MAKE_TAG('m','l','y','m')
+#define mymr_tag MS_MAKE_TAG('m','y','m','r')
 
 static void test_ScriptItemize( void )
 {
@@ -296,6 +297,11 @@ static void test_ScriptItemize( void )
     static const itemTest t231[3] = {{{0,0,0,0,0},0,0,0,0,0,FALSE},{{0,0,0,0,0},3,0,0,0,0,FALSE},{{0,0,0,0,0},6,0,0,0,-1,FALSE}};
     static const itemTest t232[3] = {{{0,0,0,0,0},0,0,1,2,0,FALSE},{{0,0,0,0,0},3,0,1,2,0,FALSE},{{0,0,0,0,0},6,0,0,0,-1,FALSE}};
 
+    /* Myanmar */
+    static const WCHAR test24[] = {0x1019,0x103c,0x1014,0x103a,0x1019,0x102c,0x1021,0x1000,0x1039,0x1001,0x101b,0x102c};
+    static const itemTest t241[2] = {{{0,0,0,0,0},0,0,0,0,mymr_tag,FALSE},{{0,0,0,0,0},12,0,0,0,-1,FALSE}};
+    static const itemTest t242[2] = {{{0,0,0,0,0},0,0,0,2,mymr_tag,TRUE,{-1,1,1,1,-1}},{{0,0,0,0,0},12,0,0,0,-1,FALSE}};
+
 
     SCRIPT_ITEM items[15];
     SCRIPT_CONTROL  Control;
@@ -353,6 +359,7 @@ static void test_ScriptItemize( void )
     test_items_ok(test21,5,NULL,NULL,1,t211,FALSE,0);
     test_items_ok(test22,6,NULL,NULL,2,t221,FALSE,0);
     test_items_ok(test23,6,NULL,NULL,2,t231,FALSE,0);
+    test_items_ok(test24,12,NULL,NULL,1,t241,FALSE,0);
 
     State.uBidiLevel = 0;
     test_items_ok(test1,4,&Control,&State,1,t11,FALSE,0);
@@ -383,6 +390,7 @@ static void test_ScriptItemize( void )
     test_items_ok(test21,5,&Control,&State,1,t211,FALSE,0);
     test_items_ok(test22,6,&Control,&State,2,t221,FALSE,0);
     test_items_ok(test23,6,&Control,&State,2,t231,FALSE,0);
+    test_items_ok(test24,12,&Control,&State,1,t241,FALSE,0);
 
     State.uBidiLevel = 1;
     test_items_ok(test1,4,&Control,&State,1,t12,FALSE,0);
@@ -413,6 +421,7 @@ static void test_ScriptItemize( void )
     test_items_ok(test21,5,&Control,&State,1,t211,FALSE,0);
     test_items_ok(test22,6,&Control,&State,2,t222,FALSE,1);
     test_items_ok(test23,6,&Control,&State,2,t232,FALSE,0);
+    test_items_ok(test24,12,&Control,&State,1,t242,FALSE,0);
 
     State.uBidiLevel = 1;
     Control.fMergeNeutralItems = TRUE;
@@ -444,6 +453,7 @@ static void test_ScriptItemize( void )
     test_items_ok(test21,5,&Control,&State,1,t211,FALSE,0);
     test_items_ok(test22,6,&Control,&State,1,t223,FALSE,2);
     test_items_ok(test23,6,&Control,&State,2,t232,FALSE,0);
+    test_items_ok(test24,12,&Control,&State,1,t242,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 359d4a3..a358f33 100644
--- a/dlls/usp10/usp10.c
+++ b/dlls/usp10/usp10.c
@@ -107,6 +107,8 @@ static const scriptRange scriptRanges[] = {
     { Script_Lao,       0xe80,  0xeff,  Script_Lao_Numeric, 0},
     /* Tibetan: U+0F00–U+0FFF */
     { Script_Tibetan,   0xf00,  0xfff,  0, 0},
+    /* Myanmar: U+1000–U+109F */
+    { Script_Myanmar,    0x1000,  0x109f, Script_Myanmar_Numeric, 0},
     /* Georgian: U+10A0–U+10FF */
     { Script_Georgian,   0x10a0,  0x10ff,  0, 0},
     /* Vedic Extensions: U+1CD0-U+1CFF */
@@ -165,6 +167,8 @@ static const scriptRange scriptRanges[] = {
     { Script_Phags_pa,   0xa840, 0xa87f, 0, 0},
     /* Devanagari Extended: U+A8E0-U+A8FF */
     { Script_Devanagari, 0xa8e0, 0xa8ff, Script_Devanagari_Numeric, 0},
+    /* Myanmar Extended-A: U+AA60–U+AA7F */
+    { Script_Myanmar,    0xaa60,  0xaa7f, Script_Myanmar_Numeric, 0},
     /* Latin Ligatures: U+FB00–U+FB06 */
     { Script_Latin,      0xfb00, 0xfb06, 0, 0},
     /* Armenian ligatures U+FB13..U+FB17 */
@@ -377,6 +381,14 @@ static const scriptData scriptInformation[] = {
      {LANG_ENGLISH, 1, 0, 0, 0, ANSI_CHARSET, 0, 0, 0, 0, 0, 0, 1, 0, 0},
      0x00000000,
      {0}},
+    {{Script_Myanmar, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}},
+     {0x55, 0, 1, 1, 1, DEFAULT_CHARSET, 0, 0, 0, 0, 1, 0, 0, 0, 0},
+     MS_MAKE_TAG('m','y','m','r'),
+     {0}},
+    {{Script_Myanmar_Numeric, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}},
+     {0x55, 1, 1, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+     MS_MAKE_TAG('m','y','m','r'),
+     {0}},
 };
 
 static const SCRIPT_PROPERTIES *script_props[] =
@@ -403,7 +415,8 @@ static const SCRIPT_PROPERTIES *script_props[] =
     &scriptInformation[38].props, &scriptInformation[39].props,
     &scriptInformation[40].props, &scriptInformation[41].props,
     &scriptInformation[42].props, &scriptInformation[43].props,
-    &scriptInformation[44].props, &scriptInformation[45].props
+    &scriptInformation[44].props, &scriptInformation[45].props,
+    &scriptInformation[46].props, &scriptInformation[47].props
 };
 
 typedef struct {
diff --git a/dlls/usp10/usp10_internal.h b/dlls/usp10/usp10_internal.h
index 6f5d3d1..bade039 100644
--- a/dlls/usp10/usp10_internal.h
+++ b/dlls/usp10/usp10_internal.h
@@ -75,6 +75,9 @@
 #define Script_Diacritical 44
 #define Script_Punctuation2 45
 #define Script_Numeric2 46
+/* Unicode Chapter 11 continued */
+#define Script_Myanmar 47
+#define Script_Myanmar_Numeric 48
 
 #define GLYPH_BLOCK_SHIFT 8
 #define GLYPH_BLOCK_SIZE  (1UL << GLYPH_BLOCK_SHIFT)




More information about the wine-cvs mailing list