Module: wine Branch: master Commit: 513a8c5020c1c683bf14caa6ac8d548874f1a56e URL: http://source.winehq.org/git/wine.git/?a=commit;h=513a8c5020c1c683bf14caa6ac...
Author: Aric Stewart aric@codeweavers.com Date: Mon Dec 12 14:50:20 2011 -0600
usp10: Add Bopomofo script.
---
dlls/usp10/shape.c | 1 + dlls/usp10/tests/usp10.c | 10 ++++++++++ dlls/usp10/usp10.c | 11 ++++++++++- dlls/usp10/usp10_internal.h | 1 + 4 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index da04361..e225041 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -641,6 +641,7 @@ static const ScriptShapeData ShapingData[] = {{ khmer_features, 5}, required_khmer_features, "khmr", "", ContextualShape_Khmer, ShapeCharGlyphProp_Khmer}, {{ no_features, 0}, NULL, "hani", "", NULL, NULL}, {{ no_features, 0}, NULL, "hani", "", NULL, NULL}, + {{ no_features, 0}, NULL, "bopo", "", 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 d17325d..77c5d5e 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -154,6 +154,7 @@ static inline void _test_items_ok(LPCWSTR string, DWORD cchString, #define talu_tag MS_MAKE_TAG('t','a','l','u') #define khmr_tag MS_MAKE_TAG('k','h','m','r') #define hani_tag MS_MAKE_TAG('h','a','n','i') +#define bopo_tag MS_MAKE_TAG('b','o','p','o')
static void test_ScriptItemize( void ) { @@ -333,6 +334,11 @@ static void test_ScriptItemize( void ) static const itemTest t291[3] = {{{0,0,0,0,0},0,0,0,0,hani_tag,FALSE},{{0,0,0,0,0},4,0,0,0,hani_tag,FALSE},{{0,0,0,0,0},10,0,0,0,-1,FALSE}}; static const itemTest t292[3] = {{{0,0,0,0,0},0,1,1,1,hani_tag,FALSE},{{0,0,0,0,0},4,0,0,2,hani_tag,FALSE},{{0,0,0,0,0},10,0,0,0,-1,FALSE}};
+ /* Bopomofo */ + static const WCHAR test30[] = {0x3113,0x3128,0x3127,0x3123,0x3108,0x3128,0x310f,0x3120}; + static const itemTest t301[2] = {{{0,0,0,0,0},0,0,0,0,bopo_tag,FALSE},{{0,0,0,0,0},8,0,0,0,-1,FALSE}}; + static const itemTest t302[2] = {{{0,0,0,0,0},0,0,0,2,bopo_tag,FALSE},{{0,0,0,0,0},8,0,0,0,-1,FALSE}}; + SCRIPT_ITEM items[15]; SCRIPT_CONTROL Control; SCRIPT_STATE State; @@ -395,6 +401,7 @@ static void test_ScriptItemize( void ) test_items_ok(test27,8,NULL,NULL,1,t271,FALSE,0); test_items_ok(test28,4,NULL,NULL,1,t281,FALSE,0); test_items_ok(test29,10,NULL,NULL,2,t291,FALSE,0); + test_items_ok(test30,8,NULL,NULL,1,t301,FALSE,0);
State.uBidiLevel = 0; test_items_ok(test1,4,&Control,&State,1,t11,FALSE,0); @@ -431,6 +438,7 @@ static void test_ScriptItemize( void ) test_items_ok(test27,8,&Control,&State,1,t271,FALSE,0); test_items_ok(test28,4,&Control,&State,1,t281,FALSE,0); test_items_ok(test29,10,&Control,&State,2,t291,FALSE,0); + test_items_ok(test30,8,&Control,&State,1,t301,FALSE,0);
State.uBidiLevel = 1; test_items_ok(test1,4,&Control,&State,1,t12,FALSE,0); @@ -467,6 +475,7 @@ static void test_ScriptItemize( void ) test_items_ok(test27,8,&Control,&State,1,t272,FALSE,0); test_items_ok(test28,4,&Control,&State,1,t282,FALSE,0); test_items_ok(test29,10,&Control,&State,2,t292,FALSE,0); + test_items_ok(test30,8,&Control,&State,1,t302,FALSE,0);
State.uBidiLevel = 1; Control.fMergeNeutralItems = TRUE; @@ -504,6 +513,7 @@ static void test_ScriptItemize( void ) test_items_ok(test27,8,&Control,&State,1,t272,FALSE,0); test_items_ok(test28,4,&Control,&State,1,t282,FALSE,0); test_items_ok(test29,10,&Control,&State,2,t292,FALSE,0); + test_items_ok(test30,8,&Control,&State,1,t302,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 2c860cf..c02a10e 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -182,8 +182,12 @@ static const scriptRange scriptRanges[] = { { Script_Ideograph ,0x3036, 0x3037, 0, 0}, { Script_CJK_Han ,0x3038, 0x303b, 0, 0}, { Script_Ideograph ,0x303c, 0x303f, 0, 0}, + /* Bopomofo: U+3100–U+312F */ + { Script_Bopomofo ,0x3100, 0x312f, 0, 0}, /* Kanbun: U+3190–U+319F */ { Script_Ideograph ,0x3190, 0x319f, 0, 0}, + /* Bopomofo Extended: U+31A0–U+31BF */ + { Script_Bopomofo ,0x31a0, 0x31bf, 0, 0}, /* CJK Strokes: U+31C0–U+31EF */ { Script_Ideograph ,0x31c0, 0x31ef, 0, 0}, /* Enclosed CJK Letters and Months: U+3200–U+32FF */ @@ -463,6 +467,10 @@ static const scriptData scriptInformation[] = { {LANG_ENGLISH, 0, 0, 0, 0, ANSI_CHARSET, 0, 0, 0, 0, 0, 0, 1, 0, 0}, MS_MAKE_TAG('h','a','n','i'), {0}}, + {{Script_Bopomofo, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}}, + {LANG_ENGLISH, 0, 0, 0, 0, ANSI_CHARSET, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + MS_MAKE_TAG('b','o','p','o'), + {0}}, };
static const SCRIPT_PROPERTIES *script_props[] = @@ -494,7 +502,8 @@ static const SCRIPT_PROPERTIES *script_props[] = &scriptInformation[48].props, &scriptInformation[49].props, &scriptInformation[50].props, &scriptInformation[51].props, &scriptInformation[52].props, &scriptInformation[53].props, - &scriptInformation[54].props, &scriptInformation[55].props + &scriptInformation[54].props, &scriptInformation[55].props, + &scriptInformation[56].props };
typedef struct { diff --git a/dlls/usp10/usp10_internal.h b/dlls/usp10/usp10_internal.h index b6633f0..deaf4df 100644 --- a/dlls/usp10/usp10_internal.h +++ b/dlls/usp10/usp10_internal.h @@ -86,6 +86,7 @@ /* Unicode Chapter 12 */ #define Script_CJK_Han 54 #define Script_Ideograph 55 +#define Script_Bopomofo 56
#define GLYPH_BLOCK_SHIFT 8 #define GLYPH_BLOCK_SIZE (1UL << GLYPH_BLOCK_SHIFT)