From a42a9940cf310a9f083e80b0dcc671733b4e0f21 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 5 Apr 2017 11:56:03 +0300 Subject: [PATCH] dwrite: Classify direction control characters as complex. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- 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 14a93e89d83..27a11f9abb3 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 a0dbb186495..21809eea110 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)