Commit 0d533dea authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Implement returning axis values from face reference.

parent f7f93399
......@@ -6280,9 +6280,16 @@ static UINT32 WINAPI fontfacereference1_GetFontAxisValueCount(IDWriteFontFaceRef
static HRESULT WINAPI fontfacereference1_GetFontAxisValues(IDWriteFontFaceReference1 *iface,
DWRITE_FONT_AXIS_VALUE *axis_values, UINT32 value_count)
{
FIXME("%p, %p, %u.\n", iface, axis_values, value_count);
struct dwrite_fontfacereference *reference = impl_from_IDWriteFontFaceReference1(iface);
return E_NOTIMPL;
TRACE("%p, %p, %u.\n", iface, axis_values, value_count);
if (value_count < reference->axis_values_count)
return E_NOT_SUFFICIENT_BUFFER;
memcpy(axis_values, reference->axis_values, value_count * sizeof(*axis_values));
return S_OK;
}
static const IDWriteFontFaceReference1Vtbl fontfacereferencevtbl =
......
......@@ -9408,6 +9408,16 @@ static void test_font_resource(void)
ok(!ret, "Unexpected result.\n");
IDWriteFontFaceReference1_Release(reference2);
memset(axis_values, 0, sizeof(axis_values));
hr = IDWriteFontFaceReference1_GetFontAxisValues(reference, axis_values, 1);
ok(hr == E_NOT_SUFFICIENT_BUFFER, "Unexpected hr %#x.\n", hr);
ok(!axis_values[0].axisTag, "Unexpected axis tag.\n");
memset(axis_values, 0, sizeof(axis_values));
hr = IDWriteFontFaceReference1_GetFontAxisValues(reference, axis_values, 2);
ok(hr == S_OK, "Failed to get axis values, hr %#x.\n", hr);
ok(axis_values[0].axisTag == DWRITE_FONT_AXIS_TAG_WEIGHT, "Unexpected axis tag.\n");
IDWriteFontFaceReference1_Release(reference);
IDWriteFontFile_Release(fontfile);
......
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