dwrite: Keep original script for NO_VISUAL case.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-07-04 10:44:48 +03:00 committed by Alexandre Julliard
parent c38be91061
commit 29abc7f172
2 changed files with 55 additions and 4 deletions

View File

@ -249,7 +249,8 @@ static HRESULT analyze_script(const WCHAR *text, UINT32 position, UINT32 length,
DWRITE_SCRIPT_ANALYSIS sa;
UINT32 pos, i, seq_length;
if (!length) return S_OK;
if (!length)
return S_OK;
sa = get_char_sa(*text);
@ -268,11 +269,11 @@ static HRESULT analyze_script(const WCHAR *text, UINT32 position, UINT32 length,
case Script_Common:
if (cur_sa.script == Script_Unknown)
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;
break;
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;
}

View File

@ -906,7 +906,57 @@ static struct sa_test sa_tests[] = {
{ 2, 2, DWRITE_SCRIPT_SHAPES_DEFAULT },
{ 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} }
};