From 368bc8aa5080a3bab338872bcea1983879d95cc1 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 31 Oct 2012 10:44:49 -0400 Subject: [PATCH] dwrite: Support for Armenian, Hebrew and complete Arabic ranges. --- dlls/dwrite/analyzer.c | 8 +++++++- dlls/dwrite/tests/analyzer.c | 29 ++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/dlls/dwrite/analyzer.c b/dlls/dwrite/analyzer.c index 541914b5df9..0a0642a52bc 100644 --- a/dlls/dwrite/analyzer.c +++ b/dlls/dwrite/analyzer.c @@ -29,10 +29,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(dwrite); enum scriptcode { Script_Arabic = 0, + Script_Armenian = 1, Script_C1Controls = 12, Script_Coptic = 13, Script_Cyrillic = 16, Script_Greek = 23, + Script_Hebrew = 29, Script_Latin = 38, Script_Symbol = 77, Script_Unknown = (UINT16)-1 @@ -79,8 +81,12 @@ static const struct script_range script_ranges[] = { /* Cyrillic Supplement range is incomplete cause it's based on Unicode 5.2 that doesn't define some Abkhaz and Azerbaijani letters, we support Unicode 6.0 range here */ { Script_Cyrillic, 0x400, 0x52f }, + /* Armenian: U+0530–U+058F */ + { Script_Armenian, 0x530, 0x58f }, + /* Hebrew: U+0590–U+05FF */ + { Script_Hebrew, 0x590, 0x5ff }, /* Arabic: U+0600–U+06FF */ - { Script_Arabic, 0x600, 0x6ef }, + { Script_Arabic, 0x600, 0x6ff }, /* unsupported range */ { Script_Unknown } }; diff --git a/dlls/dwrite/tests/analyzer.c b/dlls/dwrite/tests/analyzer.c index c610357dcaf..648759f45a5 100644 --- a/dlls/dwrite/tests/analyzer.c +++ b/dlls/dwrite/tests/analyzer.c @@ -391,17 +391,19 @@ static IDWriteTextAnalysisSourceVtbl analysissourcevtbl = { static IDWriteTextAnalysisSource analysissource = { &analysissourcevtbl }; struct sa_test { - const WCHAR string[20]; + const WCHAR string[50]; int item_count; struct script_analysis sa[10]; }; enum scriptcode { Script_Arabic = 0, + Script_Armenian = 1, Script_C1Controls = 12, Script_Coptic = 13, Script_Cyrillic = 16, Script_Greek = 23, + Script_Hebrew = 29, Script_Latin = 38, Script_Symbol = 77 }; @@ -434,6 +436,14 @@ static struct sa_test sa_tests[] = { {0x064a,0x064f,0x0633,0x0627,0x0648,0x0650,0x064a,0}, 1, { { 0, 7, { Script_Arabic, DWRITE_SCRIPT_SHAPES_DEFAULT } }} }, + { + /* Arabic */ + {0x0627,0x0644,0x0635,0x0651,0x0650,0x062d,0x0629,0x064f,' ',0x062a,0x064e, + 0x0627,0x062c,0x064c,' ',0x0639,0x064e,0x0644,0x0649,' ', + 0x0631,0x064f,0x0624,0x0648,0x0633,0x0650,' ',0x0627,0x0644, + 0x0623,0x0635,0x0650,0x062d,0x0651,0x064e,0x0627,0x0621,0x0650,0x06f0,0x06f5,0}, 1, + { { 0, 40, { Script_Arabic, DWRITE_SCRIPT_SHAPES_DEFAULT } }} + }, { /* Arabic, Latin */ {'1','2','3','-','5','2',0x064a,0x064f,0x0633,0x0627,0x0648,0x0650,0x064a,'7','1','.',0}, 1, @@ -505,6 +515,23 @@ static struct sa_test sa_tests[] = { {0x400,0x40f,0x410,0x44f,0x450,0x45f,0x460,0x481,0x48a,0x4f0,0x4fa,0x4ff,0x500,0x510,0x520,0}, 1, { { 0, 15, { Script_Cyrillic, DWRITE_SCRIPT_SHAPES_DEFAULT } }} }, + { + /* Armenian */ + {0x531,0x540,0x559,0x55f,0x570,0x589,0x58a,0}, 1, + { { 0, 7, { Script_Armenian, DWRITE_SCRIPT_SHAPES_DEFAULT } }} + }, + { + /* Hebrew */ + {0x5e9,0x5dc,0x5d5,0x5dd,0}, 1, + { { 0, 4, { Script_Hebrew, DWRITE_SCRIPT_SHAPES_DEFAULT } }} + }, + { + /* Hebrew */ + {'p','a','r','t',' ','o','n','e',' ',0x5d7,0x5dc,0x5e7,' ',0x5e9,0x5ea,0x5d9,0x5d9,0x5dd,' ','p','a','r','t',' ','t','h','r','e','e',0}, 3, + { { 0, 9, { Script_Latin, DWRITE_SCRIPT_SHAPES_DEFAULT } }, + { 9, 10, { Script_Hebrew, DWRITE_SCRIPT_SHAPES_DEFAULT } }, + { 19, 10, { Script_Latin, DWRITE_SCRIPT_SHAPES_DEFAULT } }} + }, /* keep this as end marker */ { {0} } };