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

dwrite: Implement IDWriteFontSet1::CreateFontResource().

parent 6fea399a
......@@ -7467,9 +7467,17 @@ static HRESULT WINAPI dwritefontset1_GetFontFaceReference(IDWriteFontSet3 *iface
static HRESULT WINAPI dwritefontset1_CreateFontResource(IDWriteFontSet3 *iface, UINT32 index, IDWriteFontResource **resource)
{
FIXME("%p, %u, %p.\n", iface, index, resource);
struct dwrite_fontset *set = impl_from_IDWriteFontSet3(iface);
return E_NOTIMPL;
TRACE("%p, %u, %p.\n", iface, index, resource);
*resource = NULL;
if (index >= set->count)
return E_INVALIDARG;
return IDWriteFactory7_CreateFontResource(set->factory, set->entries[index]->file,
set->entries[index]->face_index, resource);
}
static HRESULT WINAPI dwritefontset1_CreateFontFace(IDWriteFontSet3 *iface, UINT32 index, IDWriteFontFace5 **fontface)
......
......@@ -10018,6 +10018,7 @@ static void test_family_font_set(void)
unsigned int count, refcount;
IDWriteFontSet1 *fontset, *fontset2;
IDWriteLocalizedStrings *values;
IDWriteFontResource *resource;
WCHAR buffW[64];
BOOL exists;
HRESULT hr;
......@@ -10070,6 +10071,13 @@ static void test_family_font_set(void)
IDWriteLocalizedStrings_Release(values);
}
hr = IDWriteFontSet1_CreateFontResource(fontset, 100, &resource);
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
hr = IDWriteFontSet1_CreateFontResource(fontset, 0, &resource);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
IDWriteFontResource_Release(resource);
IDWriteFontSet1_Release(fontset2);
IDWriteFontSet1_Release(fontset);
......
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