dwrite: Implement IDWriteFontSet::GetFontFaceReference().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
91ab9018d2
commit
a6bdbc7146
|
@ -7162,9 +7162,19 @@ static UINT32 WINAPI dwritefontset_GetFontCount(IDWriteFontSet3 *iface)
|
|||
static HRESULT WINAPI dwritefontset_GetFontFaceReference(IDWriteFontSet3 *iface, UINT32 index,
|
||||
IDWriteFontFaceReference **reference)
|
||||
{
|
||||
FIXME("%p, %u, %p.\n", iface, index, reference);
|
||||
struct dwrite_fontset *set = impl_from_IDWriteFontSet3(iface);
|
||||
struct dwrite_fontset_entry *entry;
|
||||
|
||||
return E_NOTIMPL;
|
||||
TRACE("%p, %u, %p.\n", iface, index, reference);
|
||||
|
||||
*reference = NULL;
|
||||
|
||||
if (index >= set->count)
|
||||
return E_INVALIDARG;
|
||||
|
||||
entry = &set->entries[index];
|
||||
return IDWriteFactory7_CreateFontFaceReference_(set->factory, entry->file, entry->face_index,
|
||||
entry->simulations, reference);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI dwritefontset_FindFontFaceReference(IDWriteFontSet3 *iface,
|
||||
|
|
|
@ -9454,22 +9454,23 @@ static void test_fontsetbuilder(void)
|
|||
setcount = IDWriteFontSet_GetFontCount(fontset);
|
||||
ok(setcount == 1, "Unexpected font count %u.\n", setcount);
|
||||
|
||||
ref2 = (void *)0xdeadbeef;
|
||||
hr = IDWriteFontSet_GetFontFaceReference(fontset, setcount, &ref2);
|
||||
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
|
||||
ok(!ref2, "Unexpected pointer.\n");
|
||||
|
||||
ref2 = NULL;
|
||||
hr = IDWriteFontSet_GetFontFaceReference(fontset, 0, &ref2);
|
||||
todo_wine
|
||||
ok(hr == S_OK, "Failed to get font face reference, hr %#x.\n", hr);
|
||||
ok(ref2 != ref, "Unexpected reference.\n");
|
||||
|
||||
ref3 = NULL;
|
||||
hr = IDWriteFontSet_GetFontFaceReference(fontset, 0, &ref3);
|
||||
todo_wine {
|
||||
ok(hr == S_OK, "Failed to get font face reference, hr %#x.\n", hr);
|
||||
ok(ref2 != ref3, "Unexpected reference.\n");
|
||||
}
|
||||
if (ref3)
|
||||
IDWriteFontFaceReference_Release(ref3);
|
||||
if (ref2)
|
||||
IDWriteFontFaceReference_Release(ref2);
|
||||
|
||||
IDWriteFontFaceReference_Release(ref3);
|
||||
IDWriteFontFaceReference_Release(ref2);
|
||||
|
||||
for (id = DWRITE_FONT_PROPERTY_ID_FAMILY_NAME; id < DWRITE_FONT_PROPERTY_ID_TOTAL; ++id)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue