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

dwrite: Store text format properties.

parent 113dd5d2
......@@ -801,36 +801,41 @@ static ULONG WINAPI dwritetextformat_Release(IDWriteTextFormat *iface)
static HRESULT WINAPI dwritetextformat_SetTextAlignment(IDWriteTextFormat *iface, DWRITE_TEXT_ALIGNMENT alignment)
{
struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
FIXME("(%p)->(%d): stub\n", This, alignment);
return E_NOTIMPL;
TRACE("(%p)->(%d)\n", This, alignment);
This->format.textalignment = alignment;
return S_OK;
}
static HRESULT WINAPI dwritetextformat_SetParagraphAlignment(IDWriteTextFormat *iface, DWRITE_PARAGRAPH_ALIGNMENT alignment)
{
struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
FIXME("(%p)->(%d): stub\n", This, alignment);
return E_NOTIMPL;
TRACE("(%p)->(%d)\n", This, alignment);
This->format.paralign = alignment;
return S_OK;
}
static HRESULT WINAPI dwritetextformat_SetWordWrapping(IDWriteTextFormat *iface, DWRITE_WORD_WRAPPING wrapping)
{
struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
FIXME("(%p)->(%d): stub\n", This, wrapping);
return E_NOTIMPL;
TRACE("(%p)->(%d)\n", This, wrapping);
This->format.wrapping = wrapping;
return S_OK;
}
static HRESULT WINAPI dwritetextformat_SetReadingDirection(IDWriteTextFormat *iface, DWRITE_READING_DIRECTION direction)
{
struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
FIXME("(%p)->(%d): stub\n", This, direction);
return E_NOTIMPL;
TRACE("(%p)->(%d)\n", This, direction);
This->format.readingdir = direction;
return S_OK;
}
static HRESULT WINAPI dwritetextformat_SetFlowDirection(IDWriteTextFormat *iface, DWRITE_FLOW_DIRECTION direction)
{
struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
FIXME("(%p)->(%d): stub\n", This, direction);
return E_NOTIMPL;
TRACE("(%p)->(%d)\n", This, direction);
This->format.flow = direction;
return S_OK;
}
static HRESULT WINAPI dwritetextformat_SetIncrementalTabStop(IDWriteTextFormat *iface, FLOAT tabstop)
......@@ -848,12 +853,15 @@ static HRESULT WINAPI dwritetextformat_SetTrimming(IDWriteTextFormat *iface, DWR
return E_NOTIMPL;
}
static HRESULT WINAPI dwritetextformat_SetLineSpacing(IDWriteTextFormat *iface, DWRITE_LINE_SPACING_METHOD spacing,
FLOAT line_spacing, FLOAT baseline)
static HRESULT WINAPI dwritetextformat_SetLineSpacing(IDWriteTextFormat *iface, DWRITE_LINE_SPACING_METHOD method,
FLOAT spacing, FLOAT baseline)
{
struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface);
FIXME("(%p)->(%d %f %f): stub\n", This, spacing, line_spacing, baseline);
return E_NOTIMPL;
TRACE("(%p)->(%d %f %f)\n", This, method, spacing, baseline);
This->format.spacingmethod = method;
This->format.spacing = spacing;
This->format.baseline = baseline;
return S_OK;
}
static DWRITE_TEXT_ALIGNMENT WINAPI dwritetextformat_GetTextAlignment(IDWriteTextFormat *iface)
......
......@@ -160,6 +160,25 @@ if (0) /* crashes on native */
ok(baseline == 0.0, "got %f\n", baseline);
ok(method == DWRITE_LINE_SPACING_METHOD_DEFAULT, "got %d\n", method);
/* setters */
hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_LEADING);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IDWriteTextFormat_SetParagraphAlignment(format, DWRITE_PARAGRAPH_ALIGNMENT_NEAR);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IDWriteTextFormat_SetWordWrapping(format, DWRITE_WORD_WRAPPING_WRAP);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IDWriteTextFormat_SetReadingDirection(format, DWRITE_READING_DIRECTION_LEFT_TO_RIGHT);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IDWriteTextFormat_SetFlowDirection(format, DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IDWriteTextFormat_SetLineSpacing(format, DWRITE_LINE_SPACING_METHOD_DEFAULT, 0.0, 0.0);
ok(hr == S_OK, "got 0x%08x\n", hr);
IDWriteTextFormat_Release(format);
}
......
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