From e94264e6bde1e733e055f48be54540a958785352 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 2 Feb 2016 01:41:11 +0300 Subject: [PATCH] dwrite: Improve SetScriptAnalysis()/SetBidiLevel() tracing. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/dwrite/analyzer.c | 5 +++++ dlls/dwrite/dwrite_private.h | 2 ++ dlls/dwrite/layout.c | 4 ++-- dlls/dwrite/tests/layout.c | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dlls/dwrite/analyzer.c b/dlls/dwrite/analyzer.c index 4b21f11101f..0f88fd9ac03 100644 --- a/dlls/dwrite/analyzer.c +++ b/dlls/dwrite/analyzer.c @@ -177,6 +177,11 @@ static const struct dwritescript_properties dwritescripts_properties[Script_Last }; #undef _OT +const char *debugstr_sa_script(UINT16 script) +{ + return script < Script_LastId ? debugstr_an((char*)&dwritescripts_properties[script].props.isoScriptCode, 4): "not defined"; +} + struct dwrite_numbersubstitution { IDWriteNumberSubstitution IDWriteNumberSubstitution_iface; LONG ref; diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h index 79b34a56d12..ce085723f54 100644 --- a/dlls/dwrite/dwrite_private.h +++ b/dlls/dwrite/dwrite_private.h @@ -99,6 +99,8 @@ static inline const char *debugstr_matrix(const DWRITE_MATRIX *m) m->dx, m->dy); } +const char *debugstr_sa_script(UINT16) DECLSPEC_HIDDEN; + static inline unsigned short get_table_entry(const unsigned short *table, WCHAR ch) { return table[table[table[ch >> 8] + ((ch >> 4) & 0x0f)] + (ch & 0xf)]; diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c index d281243ad51..93c9c7b58d8 100644 --- a/dlls/dwrite/layout.c +++ b/dlls/dwrite/layout.c @@ -3977,7 +3977,7 @@ static HRESULT WINAPI dwritetextlayout_sink_SetScriptAnalysis(IDWriteTextAnalysi struct dwrite_textlayout *layout = impl_from_IDWriteTextAnalysisSink1(iface); struct layout_run *run; - TRACE("%u %u script=%d\n", position, length, sa->script); + TRACE("[%u,%u) script=%u:%s\n", position, position + length, sa->script, debugstr_sa_script(sa->script)); run = alloc_layout_run(LAYOUT_RUN_REGULAR); if (!run) @@ -4009,7 +4009,7 @@ static HRESULT WINAPI dwritetextlayout_sink_SetBidiLevel(IDWriteTextAnalysisSink struct dwrite_textlayout *layout = impl_from_IDWriteTextAnalysisSink1(iface); struct layout_run *cur_run; - TRACE("%u %u %u %u\n", position, length, explicitLevel, resolvedLevel); + TRACE("[%u,%u) %u %u\n", position, position + length, explicitLevel, resolvedLevel); LIST_FOR_EACH_ENTRY(cur_run, &layout->runs, struct layout_run, entry) { struct regular_layout_run *cur = &cur_run->u.regular; diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c index fe760c6d9af..bc49b2f8ab5 100644 --- a/dlls/dwrite/tests/layout.c +++ b/dlls/dwrite/tests/layout.c @@ -1410,7 +1410,7 @@ static const struct drawcall_entry draw_seq2[] = { }; static const struct drawcall_entry draw_seq3[] = { - { DRAW_GLYPHRUN }, + { DRAW_GLYPHRUN, {0x202a,0x202c,0} }, { DRAW_GLYPHRUN, {'a','b',0} }, { DRAW_LAST_KIND } };