dwrite: Set leading text alignment for default trimming sign.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2017-08-24 14:25:07 +03:00 committed by Alexandre Julliard
parent d58166d47c
commit cc49c40f05
2 changed files with 22 additions and 0 deletions

View File

@ -5148,6 +5148,8 @@ HRESULT create_trimmingsign(IDWriteFactory5 *factory, IDWriteTextFormat *format,
IDWriteTextLayout_SetWordWrapping(This->layout, DWRITE_WORD_WRAPPING_NO_WRAP);
IDWriteTextLayout_SetParagraphAlignment(This->layout, DWRITE_PARAGRAPH_ALIGNMENT_NEAR);
IDWriteTextLayout_SetTextAlignment(This->layout, DWRITE_TEXT_ALIGNMENT_LEADING);
*sign = &This->IDWriteInlineObject_iface;
return S_OK;

View File

@ -1237,6 +1237,7 @@ static void test_CreateEllipsisTrimmingSign(void)
static const WCHAR engbW[] = {'e','n','-','G','B',0};
DWRITE_INLINE_OBJECT_METRICS metrics;
DWRITE_BREAK_CONDITION before, after;
struct renderer_context ctxt;
IDWriteTextFormat *format;
IDWriteInlineObject *sign;
IDWriteFactory *factory;
@ -1300,6 +1301,25 @@ if (0) {/* crashes on native */
ok(hr == S_OK, "Failed to draw trimming sign, hr %#x.\n", hr);
ok_sequence(sequences, RENDERER_ID, drawellipsis_seq, "ellipsis sign draw with effect test", FALSE);
memset(&ctxt, 0, sizeof(ctxt));
hr = IDWriteInlineObject_Draw(sign, &ctxt, &testrenderer, 123.0f, 456.0f, FALSE, FALSE, NULL);
ok(hr == S_OK, "Failed to draw trimming sign, hr %#x.\n", hr);
ok(ctxt.originX == 123.0f && ctxt.originY == 456.0f, "Unexpected drawing origin\n");
IDWriteInlineObject_Release(sign);
/* Centered format */
hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_CENTER);
ok(hr == S_OK, "Failed to set text alignment, hr %#x.\n", hr);
hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &sign);
ok(hr == S_OK, "got 0x%08x\n", hr);
memset(&ctxt, 0, sizeof(ctxt));
hr = IDWriteInlineObject_Draw(sign, &ctxt, &testrenderer, 123.0f, 456.0f, FALSE, FALSE, NULL);
ok(hr == S_OK, "Failed to draw trimming sign, hr %#x.\n", hr);
ok(ctxt.originX == 123.0f && ctxt.originY == 456.0f, "Unexpected drawing origin\n");
IDWriteInlineObject_Release(sign);
/* non-orthogonal flow/reading combination */