dwrite: Use itemizer hint to reset invisible run glyph count.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
297b3d080a
commit
fca83b0915
|
@ -965,10 +965,9 @@ static HRESULT layout_compute_runs(struct dwrite_textlayout *layout)
|
|||
run->run.glyphAdvances = run->advances;
|
||||
run->run.glyphOffsets = run->offsets;
|
||||
|
||||
/* Special treatment of control script, shaping code adds normal glyphs for it,
|
||||
with non-zero advances, and layout code exposes those as zero width clusters,
|
||||
so we have to do it manually. */
|
||||
if (run->sa.script == Script_Common)
|
||||
/* Special treatment for runs that don't produce visual output, shaping code adds normal glyphs for them,
|
||||
with valid cluster map and potentially with non-zero advances; layout code exposes those as zero width clusters. */
|
||||
if (run->sa.shapes == DWRITE_SCRIPT_SHAPES_NO_VISUAL)
|
||||
run->run.glyphCount = 0;
|
||||
else
|
||||
run->run.glyphCount = run->glyphcount;
|
||||
|
|
|
@ -33,7 +33,6 @@ static const WCHAR tahomaW[] = {'T','a','h','o','m','a',0};
|
|||
static const WCHAR enusW[] = {'e','n','-','u','s',0};
|
||||
|
||||
static DWRITE_SCRIPT_ANALYSIS g_sa;
|
||||
static DWRITE_SCRIPT_ANALYSIS g_control_sa;
|
||||
|
||||
/* test IDWriteTextAnalysisSink */
|
||||
static HRESULT WINAPI analysissink_QueryInterface(IDWriteTextAnalysisSink *iface, REFIID riid, void **obj)
|
||||
|
@ -513,7 +512,9 @@ static HRESULT WINAPI testrenderer_DrawGlyphRun(IDWriteTextRenderer *iface,
|
|||
|
||||
/* see what's reported for control codes runs */
|
||||
get_script_analysis(descr->string, descr->stringLength, &sa);
|
||||
if (sa.script == g_control_sa.script) {
|
||||
if (sa.shapes == DWRITE_SCRIPT_SHAPES_NO_VISUAL) {
|
||||
UINT32 i;
|
||||
|
||||
/* glyphs are not reported at all for control code runs */
|
||||
ok(run->glyphCount == 0, "got %u\n", run->glyphCount);
|
||||
ok(run->glyphAdvances != NULL, "advances array %p\n", run->glyphAdvances);
|
||||
|
@ -523,6 +524,8 @@ static HRESULT WINAPI testrenderer_DrawGlyphRun(IDWriteTextRenderer *iface,
|
|||
ok(descr->string != NULL, "got string %p\n", descr->string);
|
||||
ok(descr->stringLength > 0, "got string length %u\n", descr->stringLength);
|
||||
ok(descr->clusterMap != NULL, "clustermap %p\n", descr->clusterMap);
|
||||
for (i = 0; i < descr->stringLength; i++)
|
||||
ok(descr->clusterMap[i] == i, "got %u\n", descr->clusterMap[i]);
|
||||
}
|
||||
|
||||
entry.kind = DRAW_GLYPHRUN;
|
||||
|
@ -4852,7 +4855,6 @@ todo_wine
|
|||
|
||||
START_TEST(layout)
|
||||
{
|
||||
static const WCHAR ctrlstrW[] = {0x202a,0};
|
||||
IDWriteFactory *factory;
|
||||
|
||||
if (!(factory = create_factory())) {
|
||||
|
@ -4860,9 +4862,6 @@ START_TEST(layout)
|
|||
return;
|
||||
}
|
||||
|
||||
/* actual script ids are not fixed */
|
||||
get_script_analysis(ctrlstrW, 1, &g_control_sa);
|
||||
|
||||
init_call_sequences(sequences, NUM_CALL_SEQUENCES);
|
||||
init_call_sequences(expected_seq, 1);
|
||||
|
||||
|
|
Loading…
Reference in New Issue