Aric Stewart : usp10: Add Braille script.

Alexandre Julliard julliard at winehq.org
Wed Dec 14 13:23:35 CST 2011


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

Author: Aric Stewart <aric at codeweavers.com>
Date:   Wed Dec 14 07:29:48 2011 -0600

usp10: Add Braille script.

---

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

diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c
index d7f7d8b..008d2cf 100644
--- a/dlls/usp10/shape.c
+++ b/dlls/usp10/shape.c
@@ -674,6 +674,7 @@ static const ScriptShapeData ShapingData[] =
     {{ no_features, 0}, NULL, "cans", "", NULL, NULL},
     {{ no_features, 0}, NULL, "ogam", "", NULL, NULL},
     {{ no_features, 0}, NULL, "runr", "", NULL, NULL},
+    {{ no_features, 0}, NULL, "brai", "", 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 29db5f7..700de68 100644
--- a/dlls/usp10/tests/usp10.c
+++ b/dlls/usp10/tests/usp10.c
@@ -167,6 +167,7 @@ static inline void _test_items_ok(LPCWSTR string, DWORD cchString,
 #define cans_tag MS_MAKE_TAG('c','a','n','s')
 #define ogam_tag MS_MAKE_TAG('o','g','a','m')
 #define runr_tag MS_MAKE_TAG('r','u','n','r')
+#define brai_tag MS_MAKE_TAG('b','r','a','i')
 
 static void test_ScriptItemize( void )
 {
@@ -423,6 +424,11 @@ static void test_ScriptItemize( void )
     static const itemTest t421[2] = {{{0,0,0,0,0},0,0,0,0,runr_tag,FALSE},{{0,0,0,0,0},6,0,0,0,-1,FALSE}};
     static const itemTest t422[4] = {{{0,0,0,0,0},0,0,0,2,runr_tag,TRUE,{-1,1,1,1,-1}},{{0,0,0,0,0},6,0,0,0,-1,FALSE}};
 
+    /* Braille */
+    static const WCHAR test43[] = {0x280f,0x2817,0x2811,0x280d,0x280a,0x2811,0x2817};
+    static const itemTest t431[2] = {{{0,0,0,0,0},0,0,0,0,brai_tag,FALSE},{{0,0,0,0,0},7,0,0,0,-1,FALSE}};
+    static const itemTest t432[4] = {{{0,0,0,0,0},0,0,0,2,brai_tag,TRUE,{-1,1,1,1,-1}},{{0,0,0,0,0},7,0,0,0,-1,FALSE}};
+
     SCRIPT_ITEM items[15];
     SCRIPT_CONTROL  Control;
     SCRIPT_STATE    State;
@@ -498,6 +504,7 @@ static void test_ScriptItemize( void )
     test_items_ok(test40,6,NULL,NULL,1,t401,FALSE,0);
     test_items_ok(test41,6,NULL,NULL,1,t411,FALSE,0);
     test_items_ok(test42,6,NULL,NULL,1,t421,FALSE,0);
+    test_items_ok(test43,7,NULL,NULL,1,t431,FALSE,0);
 
     State.uBidiLevel = 0;
     test_items_ok(test1,4,&Control,&State,1,t11,FALSE,0);
@@ -547,6 +554,7 @@ static void test_ScriptItemize( void )
     test_items_ok(test40,6,&Control,&State,1,t401,FALSE,0);
     test_items_ok(test41,6,&Control,&State,1,t411,FALSE,0);
     test_items_ok(test42,6,&Control,&State,1,t421,FALSE,0);
+    test_items_ok(test43,7,&Control,&State,1,t431,FALSE,0);
 
     State.uBidiLevel = 1;
     test_items_ok(test1,4,&Control,&State,1,t12,FALSE,0);
@@ -596,6 +604,7 @@ static void test_ScriptItemize( void )
     test_items_ok(test40,6,&Control,&State,1,t402,FALSE,0);
     test_items_ok(test41,6,&Control,&State,3,t412,FALSE,b412);
     test_items_ok(test42,6,&Control,&State,1,t422,FALSE,0);
+    test_items_ok(test43,7,&Control,&State,1,t432,FALSE,0);
 
     State.uBidiLevel = 1;
     Control.fMergeNeutralItems = TRUE;
@@ -646,6 +655,7 @@ static void test_ScriptItemize( void )
     test_items_ok(test40,6,&Control,&State,1,t402,FALSE,0);
     test_items_ok(test41,6,&Control,&State,3,t412,FALSE,b412);
     test_items_ok(test42,6,&Control,&State,1,t422,FALSE,0);
+    test_items_ok(test43,7,&Control,&State,1,t432,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 a97f8ba..1efeed9 100644
--- a/dlls/usp10/usp10.c
+++ b/dlls/usp10/usp10.c
@@ -174,6 +174,8 @@ static const scriptRange scriptRanges[] = {
     /* Miscellaneous Mathematical Symbols-A : U+27c0 –U+27ef */
     /* Supplemental Arrows-A : U+27f0 –U+27ff */
     { Script_Latin,      0x2100, 0x27ff, 0, 0},
+    /* Braille Patterns: U+2800–U+28FF */
+    { Script_Braille,    0x2800, 0x28ff, 0, 0},
     /* Supplemental Arrows-B : U+2900 –U+297f */
     /* Miscellaneous Mathematical Symbols-B : U+2980 –U+29ff */
     /* Supplemental Mathematical Operators : U+2a00 –U+2aff */
@@ -580,6 +582,10 @@ static const scriptData scriptInformation[] = {
      {0, 0, 1, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 0, 0, 0, 0, 0, 0},
      MS_MAKE_TAG('r','u','n','r'),
      {'S','e','g','o','e',' ','U','I',' ','S','y','m','b','o','l'}},
+    {{Script_Braille, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}},
+     {LANG_ENGLISH, 0, 1, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+     MS_MAKE_TAG('b','r','a','i'),
+     {'S','e','g','o','e',' ','U','I',' ','S','y','m','b','o','l'}},
 };
 
 static const SCRIPT_PROPERTIES *script_props[] =
@@ -619,7 +625,8 @@ static const SCRIPT_PROPERTIES *script_props[] =
     &scriptInformation[64].props, &scriptInformation[65].props,
     &scriptInformation[66].props, &scriptInformation[67].props,
     &scriptInformation[68].props, &scriptInformation[69].props,
-    &scriptInformation[70].props, &scriptInformation[71].props
+    &scriptInformation[70].props, &scriptInformation[71].props,
+    &scriptInformation[72].props
 };
 
 typedef struct {
diff --git a/dlls/usp10/usp10_internal.h b/dlls/usp10/usp10_internal.h
index 9ff4e60..2853f6a 100644
--- a/dlls/usp10/usp10_internal.h
+++ b/dlls/usp10/usp10_internal.h
@@ -104,6 +104,8 @@
 /* Unicode Chapter 14 */
 #define Script_Ogham 70
 #define Script_Runic 71
+/* Unicode Chapter 15 */
+#define Script_Braille 72
 
 #define GLYPH_BLOCK_SHIFT 8
 #define GLYPH_BLOCK_SIZE  (1UL << GLYPH_BLOCK_SHIFT)




More information about the wine-cvs mailing list