[PATCH] dwrite: Add partial implementation for IDWriteFontFaceReference1::CreateFontFace().
Signed-off-by: Nikolay Sivov <nsivov(a)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); -- 2.25.0
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64910 Your paranoid android. === w2008s64 (32 bit report) === === w8 (32 bit report) === === w8adm (32 bit report) === === w864 (32 bit report) === Report validation errors: dwrite:font has no test summary line (early exit of the main process?) === w1064v1507 (32 bit report) === === w1064v1809 (32 bit report) === === w1064v1809_2scr (32 bit report) === === w1064v1809_ar (32 bit report) === === w1064v1809_he (32 bit report) === Report validation errors: dwrite:font has no test summary line (early exit of the main process?) === w1064v1809_ja (32 bit report) === Report validation errors: dwrite:font has no test summary line (early exit of the main process?) === w1064v1809_zh_CN (32 bit report) === === w2008s64 (64 bit report) === === w864 (64 bit report) === === w1064v1507 (64 bit report) === === w1064v1809 (64 bit report) === === debian10 (32 bit report) === === debian10 (32 bit French report) === === debian10 (32 bit Japanese:Japan report) === === debian10 (32 bit Chinese:China report) === === debian10 (32 bit WoW report) === === debian10 (64 bit WoW report) ===
participants (2)
-
Marvin -
Nikolay Sivov