Commit 2fe60ff6 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

usp10: Windows breaks punctuation into 2 different script types.

parent 71440868
...@@ -583,6 +583,7 @@ static const ScriptShapeData ShapingData[] = ...@@ -583,6 +583,7 @@ static const ScriptShapeData ShapingData[] =
{{ devanagari_features, 6}, required_telugu_features, "mlym", "mlm2", ContextualShape_Malayalam, ShapeCharGlyphProp_Malayalam}, {{ devanagari_features, 6}, required_telugu_features, "mlym", "mlm2", ContextualShape_Malayalam, ShapeCharGlyphProp_Malayalam},
{{ devanagari_features, 6}, required_telugu_features, "mlym", "mlm2", ContextualShape_Malayalam, ShapeCharGlyphProp_Malayalam}, {{ devanagari_features, 6}, required_telugu_features, "mlym", "mlm2", ContextualShape_Malayalam, ShapeCharGlyphProp_Malayalam},
{{ standard_features, 2}, NULL, "" , "", NULL, NULL}, {{ standard_features, 2}, NULL, "" , "", NULL, NULL},
{{ standard_features, 2}, NULL, "latn" , "", NULL, NULL},
}; };
static INT GSUB_is_glyph_covered(LPCVOID table , UINT glyph) static INT GSUB_is_glyph_covered(LPCVOID table , UINT glyph)
......
...@@ -285,6 +285,13 @@ static void test_ScriptItemize( void ) ...@@ -285,6 +285,13 @@ static void test_ScriptItemize( void )
static const WCHAR test21[] = {0x0710, 0x0712, 0x0308, 0x0712, 0x0714,0}; static const WCHAR test21[] = {0x0710, 0x0712, 0x0308, 0x0712, 0x0714,0};
static const itemTest t211[2] = {{{0,0,0,0,0},0,1,1,1,syrc_tag,FALSE},{{0,0,0,0,0},5,0,0,0,-1,FALSE}}; static const itemTest t211[2] = {{{0,0,0,0,0},0,1,1,1,syrc_tag,FALSE},{{0,0,0,0,0},5,0,0,0,-1,FALSE}};
/* Latin Punctuation */
static const WCHAR test22[] = {'#','$',',','!','\"','*',0};
static const itemTest t221[3] = {{{0,0,0,0,0},0,0,0,0,latn_tag,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 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}};
SCRIPT_ITEM items[15]; SCRIPT_ITEM items[15];
SCRIPT_CONTROL Control; SCRIPT_CONTROL Control;
SCRIPT_STATE State; SCRIPT_STATE State;
...@@ -339,6 +346,7 @@ static void test_ScriptItemize( void ) ...@@ -339,6 +346,7 @@ static void test_ScriptItemize( void )
test_items_ok(test19,6,NULL,NULL,1,t191,FALSE,0); test_items_ok(test19,6,NULL,NULL,1,t191,FALSE,0);
test_items_ok(test20,5,NULL,NULL,2,t201,FALSE,0); 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(test21,5,NULL,NULL,1,t211,FALSE,0);
test_items_ok(test22,6,NULL,NULL,2,t221,FALSE,0);
State.uBidiLevel = 0; State.uBidiLevel = 0;
test_items_ok(test1,4,&Control,&State,1,t11,FALSE,0); test_items_ok(test1,4,&Control,&State,1,t11,FALSE,0);
...@@ -367,6 +375,7 @@ static void test_ScriptItemize( void ) ...@@ -367,6 +375,7 @@ static void test_ScriptItemize( void )
test_items_ok(test19,6,&Control,&State,1,t191,FALSE,0); test_items_ok(test19,6,&Control,&State,1,t191,FALSE,0);
test_items_ok(test20,5,&Control,&State,2,t201,FALSE,0); 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(test21,5,&Control,&State,1,t211,FALSE,0);
test_items_ok(test22,6,&Control,&State,2,t221,FALSE,0);
State.uBidiLevel = 1; State.uBidiLevel = 1;
test_items_ok(test1,4,&Control,&State,1,t12,FALSE,0); test_items_ok(test1,4,&Control,&State,1,t12,FALSE,0);
...@@ -395,6 +404,7 @@ static void test_ScriptItemize( void ) ...@@ -395,6 +404,7 @@ static void test_ScriptItemize( void )
test_items_ok(test19,6,&Control,&State,1,t192,FALSE,0); test_items_ok(test19,6,&Control,&State,1,t192,FALSE,0);
test_items_ok(test20,5,&Control,&State,2,t202,FALSE,0); 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(test21,5,&Control,&State,1,t211,FALSE,0);
test_items_ok(test22,6,&Control,&State,2,t222,FALSE,1);
State.uBidiLevel = 1; State.uBidiLevel = 1;
Control.fMergeNeutralItems = TRUE; Control.fMergeNeutralItems = TRUE;
...@@ -424,6 +434,7 @@ static void test_ScriptItemize( void ) ...@@ -424,6 +434,7 @@ static void test_ScriptItemize( void )
test_items_ok(test19,6,&Control,&State,1,t192,FALSE,0); test_items_ok(test19,6,&Control,&State,1,t192,FALSE,0);
test_items_ok(test20,5,&Control,&State,2,t202,FALSE,0); 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(test21,5,&Control,&State,1,t211,FALSE,0);
test_items_ok(test22,6,&Control,&State,1,t223,FALSE,2);
} }
static inline void _test_shape_ok(int valid, HDC hdc, LPCWSTR string, static inline void _test_shape_ok(int valid, HDC hdc, LPCWSTR string,
......
...@@ -362,6 +362,10 @@ static const scriptData scriptInformation[] = { ...@@ -362,6 +362,10 @@ static const scriptData scriptInformation[] = {
{LANG_ENGLISH, 0, 1, 0, 1, ANSI_CHARSET, 0, 0, 0, 0, 0, 1, 1, 0, 0}, {LANG_ENGLISH, 0, 1, 0, 1, ANSI_CHARSET, 0, 0, 0, 0, 0, 1, 1, 0, 0},
0x00000000, 0x00000000,
{0}}, {0}},
{{Script_Punctuation2, 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, 0, 0, 0},
MS_MAKE_TAG('l','a','t','n'),
{0}},
}; };
static const SCRIPT_PROPERTIES *script_props[] = static const SCRIPT_PROPERTIES *script_props[] =
...@@ -522,14 +526,19 @@ static WCHAR mirror_char( WCHAR ch ) ...@@ -522,14 +526,19 @@ static WCHAR mirror_char( WCHAR ch )
static WORD get_char_script( WCHAR ch) static WORD get_char_script( WCHAR ch)
{ {
static const WCHAR latin_punc[] = {'#','$','&','\'',',',';','<','>','?','@','\\','^','_','`','{','|','}','~', 0x00a0, 0};
WORD type = 0; WORD type = 0;
int i; int i;
if (ch == 0xc || ch == 0x20 || ch == 0x202f) if (ch == 0xc || ch == 0x20 || ch == 0x202f)
return Script_CR; return Script_CR;
/* These punctuation are seperated out as Latin punctuation */
if (strchrW(latin_punc,ch))
return Script_Punctuation2;
/* These chars are itemized as Punctuation by Windows */ /* These chars are itemized as Punctuation by Windows */
if (ch == 0x2212 || ch == 0x2044 || ch == 0x00a0) if (ch == 0x2212 || ch == 0x2044)
return Script_Punctuation; return Script_Punctuation;
GetStringTypeW(CT_CTYPE1, &ch, 1, &type); GetStringTypeW(CT_CTYPE1, &ch, 1, &type);
......
...@@ -73,6 +73,7 @@ ...@@ -73,6 +73,7 @@
#define Script_Malayalam_Numeric 43 #define Script_Malayalam_Numeric 43
/* More supplemental */ /* More supplemental */
#define Script_Diacritical 44 #define Script_Diacritical 44
#define Script_Punctuation2 45
#define GLYPH_BLOCK_SHIFT 8 #define GLYPH_BLOCK_SHIFT 8
#define GLYPH_BLOCK_SIZE (1UL << GLYPH_BLOCK_SHIFT) #define GLYPH_BLOCK_SIZE (1UL << GLYPH_BLOCK_SHIFT)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment