Commit 897c1d03 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Fix IDWriteFactory3 methods order.

parent 54b89a29
...@@ -1261,22 +1261,22 @@ static HRESULT WINAPI dwritefactory3_CreateCustomRenderingParams(IDWriteFactory3 ...@@ -1261,22 +1261,22 @@ static HRESULT WINAPI dwritefactory3_CreateCustomRenderingParams(IDWriteFactory3
gridfit_mode, params); gridfit_mode, params);
} }
static HRESULT WINAPI dwritefactory3_CreateFontFaceReference(IDWriteFactory3 *iface, WCHAR const *path, FILETIME const *writetime, static HRESULT WINAPI dwritefactory3_CreateFontFaceReference_(IDWriteFactory3 *iface, IDWriteFontFile *file, UINT32 index,
UINT32 index, DWRITE_FONT_SIMULATIONS simulations, IDWriteFontFaceReference **reference) DWRITE_FONT_SIMULATIONS simulations, IDWriteFontFaceReference **reference)
{ {
struct dwritefactory *This = impl_from_IDWriteFactory3(iface); struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
FIXME("(%p)->(%s %p %u %x, %p): stub\n", This, debugstr_w(path), writetime, index, simulations, reference); FIXME("(%p)->(%p %u %x %p): stub\n", This, file, index, simulations, reference);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI dwritefactory3_CreateFontFaceReference_(IDWriteFactory3 *iface, IDWriteFontFile *file, UINT32 index, static HRESULT WINAPI dwritefactory3_CreateFontFaceReference(IDWriteFactory3 *iface, WCHAR const *path, FILETIME const *writetime,
DWRITE_FONT_SIMULATIONS simulations, IDWriteFontFaceReference **reference) UINT32 index, DWRITE_FONT_SIMULATIONS simulations, IDWriteFontFaceReference **reference)
{ {
struct dwritefactory *This = impl_from_IDWriteFactory3(iface); struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
FIXME("(%p)->(%p %u %x %p): stub\n", This, file, index, simulations, reference); FIXME("(%p)->(%s %p %u %x, %p): stub\n", This, debugstr_w(path), writetime, index, simulations, reference);
return E_NOTIMPL; return E_NOTIMPL;
} }
...@@ -1362,8 +1362,8 @@ static const struct IDWriteFactory3Vtbl dwritefactoryvtbl = { ...@@ -1362,8 +1362,8 @@ static const struct IDWriteFactory3Vtbl dwritefactoryvtbl = {
dwritefactory2_CreateGlyphRunAnalysis, dwritefactory2_CreateGlyphRunAnalysis,
dwritefactory3_CreateGlyphRunAnalysis, dwritefactory3_CreateGlyphRunAnalysis,
dwritefactory3_CreateCustomRenderingParams, dwritefactory3_CreateCustomRenderingParams,
dwritefactory3_CreateFontFaceReference,
dwritefactory3_CreateFontFaceReference_, dwritefactory3_CreateFontFaceReference_,
dwritefactory3_CreateFontFaceReference,
dwritefactory3_GetSystemFontSet, dwritefactory3_GetSystemFontSet,
dwritefactory3_CreateFontSetBuilder, dwritefactory3_CreateFontSetBuilder,
dwritefactory3_CreateFontCollectionFromFontSet, dwritefactory3_CreateFontCollectionFromFontSet,
...@@ -1419,8 +1419,8 @@ static const struct IDWriteFactory3Vtbl shareddwritefactoryvtbl = { ...@@ -1419,8 +1419,8 @@ static const struct IDWriteFactory3Vtbl shareddwritefactoryvtbl = {
dwritefactory2_CreateGlyphRunAnalysis, dwritefactory2_CreateGlyphRunAnalysis,
dwritefactory3_CreateGlyphRunAnalysis, dwritefactory3_CreateGlyphRunAnalysis,
dwritefactory3_CreateCustomRenderingParams, dwritefactory3_CreateCustomRenderingParams,
dwritefactory3_CreateFontFaceReference,
dwritefactory3_CreateFontFaceReference_, dwritefactory3_CreateFontFaceReference_,
dwritefactory3_CreateFontFaceReference,
dwritefactory3_GetSystemFontSet, dwritefactory3_GetSystemFontSet,
dwritefactory3_CreateFontSetBuilder, dwritefactory3_CreateFontSetBuilder,
dwritefactory3_CreateFontCollectionFromFontSet, dwritefactory3_CreateFontCollectionFromFontSet,
......
...@@ -5792,6 +5792,54 @@ static void test_HasCharacter(void) ...@@ -5792,6 +5792,54 @@ static void test_HasCharacter(void)
IDWriteFactory_Release(factory); IDWriteFactory_Release(factory);
} }
static void test_CreateFontFaceReference(void)
{
static const WCHAR dummyW[] = {'d','u','m','m','y',0};
IDWriteFontFaceReference *ref;
IDWriteFactory3 *factory3;
IDWriteFactory *factory;
UINT32 index;
WCHAR *path;
HRESULT hr;
factory = create_factory();
hr = IDWriteFactory_QueryInterface(factory, &IID_IDWriteFactory3, (void**)&factory3);
IDWriteFactory_Release(factory);
if (FAILED(hr)) {
win_skip("CreateFontFaceReference() is not supported.\n");
return;
}
path = create_testfontfile(test_fontfile);
hr = IDWriteFactory3_CreateFontFaceReference(factory3, NULL, NULL, 0, DWRITE_FONT_SIMULATIONS_NONE, &ref);
todo_wine
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
/* test file is not a collection, but reference could still be created */
hr = IDWriteFactory3_CreateFontFaceReference(factory3, path, NULL, 1, DWRITE_FONT_SIMULATIONS_NONE, &ref);
todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
if (hr == S_OK) {
index = IDWriteFontFaceReference_GetFontFaceIndex(ref);
ok(index == 1, "got %u\n", index);
}
/* path however has to be valid */
hr = IDWriteFactory3_CreateFontFaceReference(factory3, dummyW, NULL, 0, DWRITE_FONT_SIMULATIONS_NONE, &ref);
todo_wine
ok(hr == DWRITE_E_FILENOTFOUND, "got 0x%08x\n", hr);
hr = IDWriteFactory3_CreateFontFaceReference(factory3, path, NULL, 0, DWRITE_FONT_SIMULATIONS_NONE, &ref);
todo_wine
ok(hr == S_OK, "got 0x%08x\n", hr);
if (hr == S_OK)
IDWriteFontFaceReference_Release(ref);
IDWriteFactory3_Release(factory3);
DELETE_FONTFILE(path);
}
START_TEST(font) START_TEST(font)
{ {
IDWriteFactory *factory; IDWriteFactory *factory;
...@@ -5846,6 +5894,7 @@ START_TEST(font) ...@@ -5846,6 +5894,7 @@ START_TEST(font)
test_GetPaletteEntries(); test_GetPaletteEntries();
test_TranslateColorGlyphRun(); test_TranslateColorGlyphRun();
test_HasCharacter(); test_HasCharacter();
test_CreateFontFaceReference();
IDWriteFactory_Release(factory); IDWriteFactory_Release(factory);
} }
...@@ -282,15 +282,17 @@ interface IDWriteFactory3 : IDWriteFactory2 ...@@ -282,15 +282,17 @@ interface IDWriteFactory3 : IDWriteFactory2
DWRITE_GRID_FIT_MODE gridfit_mode, DWRITE_GRID_FIT_MODE gridfit_mode,
IDWriteRenderingParams3 **params); IDWriteRenderingParams3 **params);
HRESULT CreateFontFaceReference( /* CreateFontFaceReference methods are listed in reversed order to make
WCHAR const *path, resulting vtable order compatible. */
FILETIME const *writetime, HRESULT CreateFontFaceReference_(
IDWriteFontFile *file,
UINT32 index, UINT32 index,
DWRITE_FONT_SIMULATIONS simulations, DWRITE_FONT_SIMULATIONS simulations,
IDWriteFontFaceReference **reference); IDWriteFontFaceReference **reference);
HRESULT CreateFontFaceReference_( HRESULT CreateFontFaceReference(
IDWriteFontFile *file, WCHAR const *path,
FILETIME const *writetime,
UINT32 index, UINT32 index,
DWRITE_FONT_SIMULATIONS simulations, DWRITE_FONT_SIMULATIONS simulations,
IDWriteFontFaceReference **reference); IDWriteFontFaceReference **reference);
......
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