Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/dwrite/font.c | 16 ++++++++++++++-- dlls/dwrite/tests/font.c | 4 ++++ 2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 353282bbd4..bd969a8fa6 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -6493,9 +6493,21 @@ static HRESULT WINAPI fontfacereference_EnqueueFileFragmentDownloadRequest(IDWri
static HRESULT WINAPI fontfacereference1_CreateFontFace(IDWriteFontFaceReference1 *iface, IDWriteFontFace5 **fontface) { - FIXME("%p, %p.\n", iface, fontface); + struct dwrite_fontfacereference *reference = impl_from_IDWriteFontFaceReference1(iface); + IDWriteFontFace3 *fontface3; + HRESULT hr;
- return E_NOTIMPL; + TRACE("%p, %p.\n", iface, fontface); + + /* FIXME: created instance should likely respect given axis. */ + if (SUCCEEDED(hr = IDWriteFontFaceReference1_CreateFontFaceWithSimulations(iface, reference->simulations, + &fontface3))) + { + hr = IDWriteFontFace3_QueryInterface(fontface3, &IID_IDWriteFontFace5, (void **)fontface); + IDWriteFontFace3_Release(fontface3); + } + + return hr; }
static UINT32 WINAPI fontfacereference1_GetFontAxisValueCount(IDWriteFontFaceReference1 *iface) diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index d21326f7c9..38a7b4f3f8 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -9633,6 +9633,10 @@ static void test_font_resource(void) 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");
+ hr = IDWriteFontFaceReference1_CreateFontFace(reference, &fontface5); + ok(hr == S_OK, "Failed to create a font face, hr %#x.\n", hr); + IDWriteFontFace5_Release(fontface5); + IDWriteFontFaceReference1_Release(reference);
IDWriteFontFile_Release(fontfile);