dwrite: Fix IDWriteFactory3 methods order.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-04-19 09:39:27 +03:00 committed by Alexandre Julliard
parent 54b89a2942
commit 897c1d03fa
3 changed files with 68 additions and 17 deletions

View file

@ -1261,16 +1261,6 @@ 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,
UINT32 index, DWRITE_FONT_SIMULATIONS simulations, IDWriteFontFaceReference **reference)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
FIXME("(%p)->(%s %p %u %x, %p): stub\n", This, debugstr_w(path), writetime, index, simulations, reference);
return E_NOTIMPL;
}
static HRESULT WINAPI dwritefactory3_CreateFontFaceReference_(IDWriteFactory3 *iface, IDWriteFontFile *file, UINT32 index, static HRESULT WINAPI dwritefactory3_CreateFontFaceReference_(IDWriteFactory3 *iface, IDWriteFontFile *file, UINT32 index,
DWRITE_FONT_SIMULATIONS simulations, IDWriteFontFaceReference **reference) DWRITE_FONT_SIMULATIONS simulations, IDWriteFontFaceReference **reference)
{ {
@ -1281,6 +1271,16 @@ static HRESULT WINAPI dwritefactory3_CreateFontFaceReference_(IDWriteFactory3 *i
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI dwritefactory3_CreateFontFaceReference(IDWriteFactory3 *iface, WCHAR const *path, FILETIME const *writetime,
UINT32 index, DWRITE_FONT_SIMULATIONS simulations, IDWriteFontFaceReference **reference)
{
struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
FIXME("(%p)->(%s %p %u %x, %p): stub\n", This, debugstr_w(path), writetime, index, simulations, reference);
return E_NOTIMPL;
}
static HRESULT WINAPI dwritefactory3_GetSystemFontSet(IDWriteFactory3 *iface, IDWriteFontSet **fontset) static HRESULT WINAPI dwritefactory3_GetSystemFontSet(IDWriteFactory3 *iface, IDWriteFontSet **fontset)
{ {
struct dwritefactory *This = impl_from_IDWriteFactory3(iface); struct dwritefactory *This = impl_from_IDWriteFactory3(iface);
@ -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 = {
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,

View file

@ -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)
test_GetPaletteEntries(); test_GetPaletteEntries();
test_TranslateColorGlyphRun(); test_TranslateColorGlyphRun();
test_HasCharacter(); test_HasCharacter();
test_CreateFontFaceReference();
IDWriteFactory_Release(factory); IDWriteFactory_Release(factory);
} }

View file

@ -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);