Nikolay Sivov : dwrite: Implement GetFontResource() for fontface.

Alexandre Julliard julliard at winehq.org
Thu Dec 5 17:14:10 CST 2019


Module: wine
Branch: master
Commit: 6f7a9158f487c5f610a6e6f664805981ab07796c
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6f7a9158f487c5f610a6e6f664805981ab07796c

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Thu Dec  5 11:56:00 2019 +0300

dwrite: Implement GetFontResource() for fontface.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dwrite/font.c       |  6 ++++--
 dlls/dwrite/tests/font.c | 13 ++-----------
 2 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index 8c58d7561a..8045bce870 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -1435,9 +1435,11 @@ static BOOL WINAPI dwritefontface5_HasVariations(IDWriteFontFace5 *iface)
 
 static HRESULT WINAPI dwritefontface5_GetFontResource(IDWriteFontFace5 *iface, IDWriteFontResource **resource)
 {
-    FIXME("%p, %p: stub\n", iface, resource);
+    struct dwrite_fontface *fontface = impl_from_IDWriteFontFace5(iface);
 
-    return E_NOTIMPL;
+    TRACE("%p, %p.\n", iface, resource);
+
+    return IDWriteFactory7_CreateFontResource(fontface->factory, fontface->files[0], fontface->index, resource);
 }
 
 static const IDWriteFontFace5Vtbl dwritefontfacevtbl =
diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c
index d06b2f555a..83d6be4449 100644
--- a/dlls/dwrite/tests/font.c
+++ b/dlls/dwrite/tests/font.c
@@ -9294,28 +9294,19 @@ if (SUCCEEDED(hr))
     ok(hr == S_OK, "Failed to get interface, hr %#x.\n", hr);
 
     hr = IDWriteFontFace5_GetFontResource(fontface5, &resource2);
-todo_wine
     ok(hr == S_OK, "Failed to get font resource, hr %#x.\n", hr);
-
-if (SUCCEEDED(hr))
-{
     ok(resource != resource2, "Unexpected resource instance.\n");
     IDWriteFontResource_Release(resource);
-}
+
     hr = IDWriteFontFace5_GetFontResource(fontface5, &resource);
-todo_wine
     ok(hr == S_OK, "Failed to get font resource, hr %#x.\n", hr);
-
-if (SUCCEEDED(hr))
-{
     ok(resource != resource2, "Unexpected resource instance.\n");
     EXPECT_REF(resource, 1);
     IDWriteFontResource_Release(resource);
     IDWriteFontResource_Release(resource2);
-}
+
     IDWriteFontFace5_Release(fontface5);
 
-    IDWriteFontResource_Release(resource);
     IDWriteFontFile_Release(fontfile);
 
     IDWriteFontFace_Release(fontface);




More information about the wine-cvs mailing list