Nikolay Sivov : dwrite: Classify direction control characters as complex.

Alexandre Julliard julliard at winehq.org
Wed Apr 5 16:17:07 CDT 2017


Module: wine
Branch: master
Commit: a42a9940cf310a9f083e80b0dcc671733b4e0f21
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a42a9940cf310a9f083e80b0dcc671733b4e0f21

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Apr  5 11:56:03 2017 +0300

dwrite: Classify direction control characters as complex.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dwrite/analyzer.c       | 4 +++-
 dlls/dwrite/tests/analyzer.c | 8 +++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dlls/dwrite/analyzer.c b/dlls/dwrite/analyzer.c
index 14a93e8..27a11f9 100644
--- a/dlls/dwrite/analyzer.c
+++ b/dlls/dwrite/analyzer.c
@@ -1524,7 +1524,9 @@ static HRESULT WINAPI dwritetextanalyzer1_GetScriptProperties(IDWriteTextAnalyze
 
 static inline BOOL is_char_from_simple_script(WCHAR c)
 {
-    if (IS_HIGH_SURROGATE(c) || IS_LOW_SURROGATE(c))
+    if (IS_HIGH_SURROGATE(c) || IS_LOW_SURROGATE(c) ||
+            /* LRM, RLM, LRE, RLE, PDF, LRO, RLO */
+            c == 0x200e || c == 0x200f || (c >= 0x202a && c <= 0x202e))
         return FALSE;
     else {
         UINT16 script = get_char_script(c);
diff --git a/dlls/dwrite/tests/analyzer.c b/dlls/dwrite/tests/analyzer.c
index a0dbb186..21809ee 100644
--- a/dlls/dwrite/tests/analyzer.c
+++ b/dlls/dwrite/tests/analyzer.c
@@ -1197,7 +1197,13 @@ static const struct textcomplexity_test textcomplexity_tests[] = {
     { {0x610,0x610,'C','D',0}, 2, FALSE, 2 },
     { {0xd800,'A','B',0},      1, FALSE, 1 },
     { {0xd800,'A','B',0},      2, FALSE, 1 },
-    { {0xdc00,'A','B',0},      2, FALSE, 1 }
+    { {0xdc00,'A','B',0},      2, FALSE, 1 },
+    { {0x202a,'A',0x202c,0},   3, FALSE, 1 },
+    { {0x200e,'A',0},          2, FALSE, 1 },
+    { {0x200f,'A',0},          2, FALSE, 1 },
+    { {0x202d,'A',0},          2, FALSE, 1 },
+    { {0x202e,'A',0},          2, FALSE, 1 },
+
 };
 
 static void test_GetTextComplexity(void)




More information about the wine-cvs mailing list