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

dwrite: Implement another CreateFontFace() variant.

parent e30607fd
...@@ -1496,18 +1496,11 @@ static HRESULT WINAPI dwritefont_HasCharacter(IDWriteFont3 *iface, UINT32 value, ...@@ -1496,18 +1496,11 @@ static HRESULT WINAPI dwritefont_HasCharacter(IDWriteFont3 *iface, UINT32 value,
return S_OK; return S_OK;
} }
static HRESULT WINAPI dwritefont_CreateFontFace(IDWriteFont3 *iface, IDWriteFontFace **face) static HRESULT WINAPI dwritefont_CreateFontFace(IDWriteFont3 *iface, IDWriteFontFace **fontface)
{ {
struct dwrite_font *This = impl_from_IDWriteFont3(iface); struct dwrite_font *This = impl_from_IDWriteFont3(iface);
HRESULT hr; TRACE("(%p)->(%p)\n", This, fontface);
return IDWriteFont3_CreateFontFace(iface, (IDWriteFontFace3**)fontface);
TRACE("(%p)->(%p)\n", This, face);
hr = get_fontface_from_font(This, (IDWriteFontFace3**)face);
if (hr == S_OK)
IDWriteFontFace_AddRef(*face);
return hr;
} }
static void WINAPI dwritefont1_GetMetrics(IDWriteFont3 *iface, DWRITE_FONT_METRICS1 *metrics) static void WINAPI dwritefont1_GetMetrics(IDWriteFont3 *iface, DWRITE_FONT_METRICS1 *metrics)
...@@ -1572,8 +1565,15 @@ static BOOL WINAPI dwritefont2_IsColorFont(IDWriteFont3 *iface) ...@@ -1572,8 +1565,15 @@ static BOOL WINAPI dwritefont2_IsColorFont(IDWriteFont3 *iface)
static HRESULT WINAPI dwritefont3_CreateFontFace(IDWriteFont3 *iface, IDWriteFontFace3 **fontface) static HRESULT WINAPI dwritefont3_CreateFontFace(IDWriteFont3 *iface, IDWriteFontFace3 **fontface)
{ {
struct dwrite_font *This = impl_from_IDWriteFont3(iface); struct dwrite_font *This = impl_from_IDWriteFont3(iface);
FIXME("(%p)->(%p): stub\n", This, fontface); HRESULT hr;
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, fontface);
hr = get_fontface_from_font(This, fontface);
if (hr == S_OK)
IDWriteFontFace3_AddRef(*fontface);
return hr;
} }
static BOOL WINAPI dwritefont3_Equals(IDWriteFont3 *iface, IDWriteFont *font) static BOOL WINAPI dwritefont3_Equals(IDWriteFont3 *iface, IDWriteFont *font)
......
...@@ -6177,17 +6177,19 @@ todo_wine ...@@ -6177,17 +6177,19 @@ todo_wine
/* references returned from IDWriteFontFace3 */ /* references returned from IDWriteFontFace3 */
hr = IDWriteFont3_CreateFontFace(font3, &fontface); hr = IDWriteFont3_CreateFontFace(font3, &fontface);
todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
if (hr == S_OK) {
hr = IDWriteFontFace3_GetFontFaceReference(fontface, &ref); hr = IDWriteFontFace3_GetFontFaceReference(fontface, &ref);
todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IDWriteFontFace3_GetFontFaceReference(fontface, &ref1); hr = IDWriteFontFace3_GetFontFaceReference(fontface, &ref1);
todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
if (hr == S_OK)
ok(ref == ref1, "got %p, %p\n", ref1, ref); ok(ref == ref1, "got %p, %p\n", ref1, ref);
if (hr == S_OK) {
hr = IDWriteFontFaceReference_CreateFontFace(ref, &fontface1); hr = IDWriteFontFaceReference_CreateFontFace(ref, &fontface1);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
ok(fontface1 == fontface, "got %p, %p\n", fontface1, fontface); ok(fontface1 == fontface, "got %p, %p\n", fontface1, fontface);
...@@ -6195,9 +6197,8 @@ if (hr == S_OK) { ...@@ -6195,9 +6197,8 @@ if (hr == S_OK) {
IDWriteFontFaceReference_Release(ref); IDWriteFontFaceReference_Release(ref);
IDWriteFontFaceReference_Release(ref1); IDWriteFontFaceReference_Release(ref1);
IDWriteFontFace3_Release(fontface);
} }
IDWriteFontFace3_Release(fontface);
IDWriteFont3_Release(font3); IDWriteFont3_Release(font3);
IDWriteFactory3_Release(factory3); IDWriteFactory3_Release(factory3);
......
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