Aric Stewart : usp10: Itemize numbers outside of the basic ascii set in a seperate script.

Alexandre Julliard julliard at winehq.org
Mon Nov 21 11:10:07 CST 2011


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

Author: Aric Stewart <aric at codeweavers.com>
Date:   Sun Nov 20 21:05:45 2011 -0700

usp10: Itemize numbers outside of the basic ascii set in a seperate script.

---

 dlls/usp10/shape.c          |    1 +
 dlls/usp10/tests/usp10.c    |    9 +++++++++
 dlls/usp10/usp10.c          |   17 ++++++++++++++---
 dlls/usp10/usp10_internal.h |    1 +
 4 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c
index dd4d23b..c463681 100644
--- a/dlls/usp10/shape.c
+++ b/dlls/usp10/shape.c
@@ -584,6 +584,7 @@ static const ScriptShapeData ShapingData[] =
     {{ devanagari_features, 6}, required_telugu_features, "mlym", "mlm2", ContextualShape_Malayalam, ShapeCharGlyphProp_Malayalam},
     {{ standard_features, 2}, NULL, "" , "", NULL, NULL},
     {{ standard_features, 2}, NULL, "latn" , "", NULL, NULL},
+    {{ standard_features, 2}, NULL, "" , "", 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 b29f592..dffc6a1 100644
--- a/dlls/usp10/tests/usp10.c
+++ b/dlls/usp10/tests/usp10.c
@@ -291,6 +291,11 @@ static void test_ScriptItemize( void )
     static const itemTest t222[3] = {{{0,0,0,0,0},0,1,1,1,latn_tag,FALSE},{{0,0,0,0,0},3,1,1,1,0,FALSE},{{0,0,0,0,0},6,0,0,0,-1,FALSE}};
     static const itemTest t223[2] = {{{0,0,0,0,0},0,1,1,1,latn_tag,FALSE},{{0,0,0,0,0},6,0,0,0,-1,FALSE}};
 
+    /* Number 2*/
+    static const WCHAR test23[] = {'1','2','3',0x00b2,0x00b3,0x2070,0};
+    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}};
+
 
     SCRIPT_ITEM items[15];
     SCRIPT_CONTROL  Control;
@@ -347,6 +352,7 @@ static void test_ScriptItemize( void )
     test_items_ok(test20,5,NULL,NULL,2,t201,FALSE,0);
     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);
 
     State.uBidiLevel = 0;
     test_items_ok(test1,4,&Control,&State,1,t11,FALSE,0);
@@ -376,6 +382,7 @@ static void test_ScriptItemize( void )
     test_items_ok(test20,5,&Control,&State,2,t201,FALSE,0);
     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);
 
     State.uBidiLevel = 1;
     test_items_ok(test1,4,&Control,&State,1,t12,FALSE,0);
@@ -405,6 +412,7 @@ static void test_ScriptItemize( void )
     test_items_ok(test20,5,&Control,&State,2,t202,FALSE,0);
     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);
 
     State.uBidiLevel = 1;
     Control.fMergeNeutralItems = TRUE;
@@ -435,6 +443,7 @@ static void test_ScriptItemize( void )
     test_items_ok(test20,5,&Control,&State,2,t202,FALSE,0);
     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);
 }
 
 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 72c00cf..1cff0ee 100644
--- a/dlls/usp10/usp10.c
+++ b/dlls/usp10/usp10.c
@@ -52,11 +52,12 @@ typedef struct _scriptRange
 
 static const scriptRange scriptRanges[] = {
     /* Basic Latin: U+0000–U+007A */
+    { Script_Latin,      0x00,   0x07a ,  Script_Numeric, Script_Punctuation},
     /* Latin-1 Supplement: U+0080–U+00FF */
     /* Latin Extended-A: U+0100–U+017F */
     /* Latin Extended-B: U+0180–U+024F */
     /* IPA Extensions: U+0250–U+02AF */
-    { Script_Latin,      0x00,   0x2af ,  Script_Numeric, Script_Punctuation},
+    { Script_Latin,      0x80,   0x2af ,  Script_Numeric2, Script_Punctuation},
     /* Combining Diacritical Marks : U+0300–U+036F */
     { Script_Diacritical,0x300,  0x36f,  0, 0},
     /* Greek: U+0370–U+03FF */
@@ -119,9 +120,15 @@ static const scriptRange scriptRanges[] = {
     /* Greek Extended: U+1F00–U+1FFF */
     { Script_Greek,      0x1f00, 0x1fff, 0, 0},
     /* General Punctuation: U+2000 –U+206f */
+    { Script_Latin,      0x2000, 0x206f, 0, 0},
     /* Superscripts and Subscripts : U+2070 –U+209f */
     /* Currency Symbols : U+20a0 –U+20cf */
-    { Script_Latin,      0x2000, 0x20cf, 0, 0},
+    { Script_Numeric2,   0x2070, 0x2070, 0, 0},
+    { Script_Latin,      0x2071, 0x2073, 0, 0},
+    { Script_Numeric2,   0x2074, 0x2079, 0, 0},
+    { Script_Latin,      0x207a, 0x207f, 0, 0},
+    { Script_Numeric2,   0x2080, 0x2089, 0, 0},
+    { Script_Latin,      0x208a, 0x20cf, 0, 0},
     /* Letterlike Symbols : U+2100 –U+214f */
     /* Number Forms : U+2150 –U+218f */
     /* Arrows : U+2190 –U+21ff */
@@ -366,6 +373,10 @@ static const scriptData scriptInformation[] = {
      {LANG_ENGLISH, 0, 0, 0, 0, ANSI_CHARSET, 0, 0, 0, 0, 0, 0, 0, 0, 0},
      MS_MAKE_TAG('l','a','t','n'),
      {0}},
+    {{Script_Numeric2, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}},
+     {LANG_ENGLISH, 1, 0, 0, 0, ANSI_CHARSET, 0, 0, 0, 0, 0, 0, 1, 0, 0},
+     0x00000000,
+     {0}},
 };
 
 static const SCRIPT_PROPERTIES *script_props[] =
@@ -392,7 +403,7 @@ 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[44].props, &scriptInformation[45].props
 };
 
 typedef struct {
diff --git a/dlls/usp10/usp10_internal.h b/dlls/usp10/usp10_internal.h
index fc9bb7f..ebf9667 100644
--- a/dlls/usp10/usp10_internal.h
+++ b/dlls/usp10/usp10_internal.h
@@ -74,6 +74,7 @@
 /* More supplemental */
 #define Script_Diacritical 44
 #define Script_Punctuation2 45
+#define Script_Numeric2 46
 
 #define GLYPH_BLOCK_SHIFT 8
 #define GLYPH_BLOCK_SIZE  (1UL << GLYPH_BLOCK_SHIFT)




More information about the wine-cvs mailing list