Commit 29abc7f1 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Keep original script for NO_VISUAL case.

parent c38be910
...@@ -249,7 +249,8 @@ static HRESULT analyze_script(const WCHAR *text, UINT32 position, UINT32 length, ...@@ -249,7 +249,8 @@ static HRESULT analyze_script(const WCHAR *text, UINT32 position, UINT32 length,
DWRITE_SCRIPT_ANALYSIS sa; DWRITE_SCRIPT_ANALYSIS sa;
UINT32 pos, i, seq_length; UINT32 pos, i, seq_length;
if (!length) return S_OK; if (!length)
return S_OK;
sa = get_char_sa(*text); sa = get_char_sa(*text);
...@@ -268,11 +269,11 @@ static HRESULT analyze_script(const WCHAR *text, UINT32 position, UINT32 length, ...@@ -268,11 +269,11 @@ static HRESULT analyze_script(const WCHAR *text, UINT32 position, UINT32 length,
case Script_Common: case Script_Common:
if (cur_sa.script == Script_Unknown) if (cur_sa.script == Script_Unknown)
cur_sa.script = sa.script; cur_sa.script = sa.script;
else if (cur_sa.script != Script_Common) else if ((cur_sa.script != Script_Common) && sa.shapes == DWRITE_SCRIPT_SHAPES_DEFAULT)
sa.script = cur_sa.script; sa.script = cur_sa.script;
break; break;
default: default:
if (cur_sa.script == Script_Unknown || cur_sa.script == Script_Common) if ((cur_sa.script == Script_Common && cur_sa.shapes == DWRITE_SCRIPT_SHAPES_DEFAULT) || cur_sa.script == Script_Unknown)
cur_sa.script = sa.script; cur_sa.script = sa.script;
} }
......
...@@ -906,7 +906,57 @@ static struct sa_test sa_tests[] = { ...@@ -906,7 +906,57 @@ static struct sa_test sa_tests[] = {
{ 2, 2, DWRITE_SCRIPT_SHAPES_DEFAULT }, { 2, 2, DWRITE_SCRIPT_SHAPES_DEFAULT },
{ 4, 2, DWRITE_SCRIPT_SHAPES_NO_VISUAL } } { 4, 2, DWRITE_SCRIPT_SHAPES_NO_VISUAL } }
}, },
/* keep this as end marker */ {
/* Inherited on its own */
{0x300,0x300,0}, 1,
{ { 0, 2, DWRITE_SCRIPT_SHAPES_DEFAULT } }
},
{
/* Inherited followed by Latin */
{0x300,0x300,'a',0}, 1,
{ { 0, 3, DWRITE_SCRIPT_SHAPES_DEFAULT } }
},
{
/* Inherited mixed with Arabic and Latin */
{0x300,'+',0x627,0x300,'a',0}, 2,
{ { 0, 4, DWRITE_SCRIPT_SHAPES_DEFAULT },
{ 4, 1, DWRITE_SCRIPT_SHAPES_DEFAULT } }
},
{
{'a',0x300,'+',0x627,0x300,')','a',0}, 3,
{ { 0, 3, DWRITE_SCRIPT_SHAPES_DEFAULT },
{ 3, 3, DWRITE_SCRIPT_SHAPES_DEFAULT },
{ 6, 1, DWRITE_SCRIPT_SHAPES_DEFAULT } }
},
/* Paired punctuation */
{
{0x627,'(','a',')','a',0}, 2,
{ { 0, 2, DWRITE_SCRIPT_SHAPES_DEFAULT },
{ 2, 3, DWRITE_SCRIPT_SHAPES_DEFAULT } }
},
{
{0x627,'[','a',']',0x627,0}, 3,
{ { 0, 2, DWRITE_SCRIPT_SHAPES_DEFAULT },
{ 2, 2, DWRITE_SCRIPT_SHAPES_DEFAULT },
{ 4, 1, DWRITE_SCRIPT_SHAPES_DEFAULT } }
},
/* Combining marks */
{
/* dotted circle - Common, followed by accent - Inherited */
{0x25cc,0x300,0}, 1,
{ { 0, 2, DWRITE_SCRIPT_SHAPES_DEFAULT } }
},
{
/* combining mark with explicit script value */
{0x25cc,0x300,0x5c4,0}, 1,
{ { 0, 3, DWRITE_SCRIPT_SHAPES_DEFAULT } }
},
{
/* inherited merges with following explicit script */
{0x25cc,0x300,'a',0}, 1,
{ { 0, 3, DWRITE_SCRIPT_SHAPES_DEFAULT } }
},
/* keep this as end test data marker */
{ {0} } { {0} }
}; };
......
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