Commit c5fce83f authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Implement support for underlines.

parent cfbac8d2
......@@ -1461,7 +1461,7 @@ static void test_Draw(void)
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, &ctxt, &testrenderer, 0.0, 0.0);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok_sequence(sequences, RENDERER_ID, draw_seq, "draw test", TRUE);
ok_sequence(sequences, RENDERER_ID, draw_seq, "draw test", FALSE);
IDWriteTextLayout_Release(layout);
/* with reduced width DrawGlyphRun() is called for every line */
......@@ -4336,6 +4336,14 @@ static const struct drawcall_entry drawunderline3_seq[] = {
{ DRAW_LAST_KIND }
};
static const struct drawcall_entry drawunderline4_seq[] = {
{ DRAW_GLYPHRUN, {'a',0} },
{ DRAW_GLYPHRUN, {'e',0} },
{ DRAW_UNDERLINE, {0}, {'e','n','-','u','s',0} },
{ DRAW_STRIKETHROUGH },
{ DRAW_LAST_KIND }
};
static void test_SetUnderline(void)
{
static const WCHAR encaW[] = {'e','n','-','C','A',0};
......@@ -4399,7 +4407,7 @@ todo_wine
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0f, 0.0f);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok_sequence(sequences, RENDERER_ID, drawunderline2_seq, "draw underline test 2", TRUE);
ok_sequence(sequences, RENDERER_ID, drawunderline2_seq, "draw underline test 2", FALSE);
/* now set different locale for second char, draw again */
range.startPosition = 0;
......@@ -4414,6 +4422,27 @@ todo_wine
IDWriteTextLayout_Release(layout);
/* 2 characters, same font properties, first with strikethrough, both underlined */
hr = IDWriteFactory_CreateTextLayout(factory, strW, 2, format, 1000.0f, 1000.0f, &layout);
ok(hr == S_OK, "got 0x%08x\n", hr);
range.startPosition = 0;
range.length = 1;
hr = IDWriteTextLayout_SetStrikethrough(layout, TRUE, range);
ok(hr == S_OK, "got 0x%08x\n", hr);
range.startPosition = 0;
range.length = 2;
hr = IDWriteTextLayout_SetUnderline(layout, TRUE, range);
ok(hr == S_OK, "got 0x%08x\n", hr);
flush_sequence(sequences, RENDERER_ID);
hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0f, 0.0f);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok_sequence(sequences, RENDERER_ID, drawunderline4_seq, "draw underline test 4", FALSE);
IDWriteTextLayout_Release(layout);
IDWriteTextFormat_Release(format);
IDWriteFactory_Release(factory);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment