Module: wine Branch: master Commit: 4d188aa20eb1f1922a73de34adaa41afa6017aad URL: http://source.winehq.org/git/wine.git/?a=commit;h=4d188aa20eb1f1922a73de34ad...
Author: Aric Stewart aric@codeweavers.com Date: Wed Dec 14 07:29:54 2011 -0600
usp10: Add Private Use Area and Surrogates Area from Unicode Chapter 16.
---
dlls/usp10/shape.c | 2 ++ dlls/usp10/tests/usp10.c | 9 +++++++++ dlls/usp10/usp10.c | 17 ++++++++++++++++- dlls/usp10/usp10_internal.h | 3 +++ 4 files changed, 30 insertions(+), 1 deletions(-)
diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index 008d2cf..d0ab0b2 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -675,6 +675,8 @@ static const ScriptShapeData ShapingData[] = {{ no_features, 0}, NULL, "ogam", "", NULL, NULL}, {{ no_features, 0}, NULL, "runr", "", NULL, NULL}, {{ no_features, 0}, NULL, "brai", "", NULL, NULL}, + {{ no_features, 0}, NULL, "", "", NULL, NULL}, + {{ no_features, 0}, 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 700de68..64cbb30 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -429,6 +429,11 @@ static void test_ScriptItemize( void ) 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}};
+ /* Private and Surrogates Area */ + static const WCHAR test44[] = {0xe000, 0xe001, 0xd800, 0xd801}; + static const itemTest t441[3] = {{{0,0,0,0,0},0,0,0,0,0,FALSE},{{0,0,0,0,0},2,0,0,0,0,FALSE},{{0,0,0,0,0},4,0,0,0,-1,FALSE}}; + static const itemTest t442[4] = {{{0,0,0,0,0},0,0,0,2,0,TRUE,{-1,1,1,1,-1}},{{0,0,0,0,0},2,0,0,2,0,TRUE,{-1,1,1,1,-1}},{{0,0,0,0,0},4,0,0,0,-1,FALSE}}; + SCRIPT_ITEM items[15]; SCRIPT_CONTROL Control; SCRIPT_STATE State; @@ -505,6 +510,7 @@ static void test_ScriptItemize( void ) 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); + test_items_ok(test44,4,NULL,NULL,2,t441,FALSE,0);
State.uBidiLevel = 0; test_items_ok(test1,4,&Control,&State,1,t11,FALSE,0); @@ -555,6 +561,7 @@ static void test_ScriptItemize( void ) 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); + test_items_ok(test44,4,&Control,&State,2,t441,FALSE,0);
State.uBidiLevel = 1; test_items_ok(test1,4,&Control,&State,1,t12,FALSE,0); @@ -605,6 +612,7 @@ static void test_ScriptItemize( void ) 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); + test_items_ok(test44,4,&Control,&State,2,t442,FALSE,0);
State.uBidiLevel = 1; Control.fMergeNeutralItems = TRUE; @@ -656,6 +664,7 @@ static void test_ScriptItemize( void ) 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); + test_items_ok(test44,4,&Control,&State,2,t442,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 1efeed9..4fcbfdf 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -258,6 +258,12 @@ static const scriptRange scriptRanges[] = { { Script_Hangul, 0xac00, 0xd7a3, 0, 0}, /* Hangul Jamo Extended-B: U+D7B0–U+D7FF */ { Script_Hangul, 0xd7b0, 0xd7ff, 0, 0}, + /* Surrogates Area: U+D800–U+DFFF */ + { Script_Surrogates, 0xd800, 0xdbfe, 0, 0}, + { Script_Private, 0xdbff, 0xdc00, 0, 0}, + { Script_Surrogates, 0xdc01, 0xdfff, 0, 0}, + /* Private Use Area: U+E000–U+F8FF */ + { Script_Private, 0xe000, 0xf8ff, 0, 0}, /* CJK Compatibility Ideographs: U+F900–U+FAFF */ { Script_CJK_Han ,0xf900, 0xfaff, 0, 0}, /* Latin Ligatures: U+FB00–U+FB06 */ @@ -586,6 +592,14 @@ static const scriptData scriptInformation[] = { {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'}}, + {{Script_Surrogates, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}}, + {LANG_ENGLISH, 0, 1, 0, 1, DEFAULT_CHARSET, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + 0x00000000, + {0}}, + {{Script_Private, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}}, + {0, 0, 0, 0, 0, DEFAULT_CHARSET, 0, 1, 0, 0, 0, 0, 1, 0, 0}, + 0x00000000, + {0}}, };
static const SCRIPT_PROPERTIES *script_props[] = @@ -626,7 +640,8 @@ static const SCRIPT_PROPERTIES *script_props[] = &scriptInformation[66].props, &scriptInformation[67].props, &scriptInformation[68].props, &scriptInformation[69].props, &scriptInformation[70].props, &scriptInformation[71].props, - &scriptInformation[72].props + &scriptInformation[72].props, &scriptInformation[73].props, + &scriptInformation[74].props };
typedef struct { diff --git a/dlls/usp10/usp10_internal.h b/dlls/usp10/usp10_internal.h index 2853f6a..1692b60 100644 --- a/dlls/usp10/usp10_internal.h +++ b/dlls/usp10/usp10_internal.h @@ -106,6 +106,9 @@ #define Script_Runic 71 /* Unicode Chapter 15 */ #define Script_Braille 72 +/* Unicode Chapter 16 */ +#define Script_Surrogates 73 +#define Script_Private 74
#define GLYPH_BLOCK_SHIFT 8 #define GLYPH_BLOCK_SIZE (1UL << GLYPH_BLOCK_SHIFT)