[PATCH 1/4] dwrite: Classify direction control characters as complex
Nikolay Sivov
nsivov at codeweavers.com
Wed Apr 5 03:56:03 CDT 2017
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
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 14a93e89d8..27a11f9abb 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 a0dbb18649..21809eea11 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)
--
2.11.0
More information about the wine-patches
mailing list