forked from Mirrors/wine-wine
dwrite/tests: Add a test for creating system collection with explicit family model.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>feature/deterministic
parent
4d3e0ba0a5
commit
6c1aff9fc7
|
@ -2400,11 +2400,14 @@ static void test_system_fontcollection(void)
|
||||||
IDWriteFontCollection *collection, *coll2;
|
IDWriteFontCollection *collection, *coll2;
|
||||||
IDWriteLocalFontFileLoader *localloader;
|
IDWriteLocalFontFileLoader *localloader;
|
||||||
IDWriteFontCollection1 *collection1;
|
IDWriteFontCollection1 *collection1;
|
||||||
|
IDWriteFontCollection2 *collection2;
|
||||||
IDWriteFontCollection3 *collection3;
|
IDWriteFontCollection3 *collection3;
|
||||||
IDWriteFactory *factory, *factory2;
|
IDWriteFactory *factory, *factory2;
|
||||||
|
DWRITE_FONT_FAMILY_MODEL model;
|
||||||
IDWriteFontFileLoader *loader;
|
IDWriteFontFileLoader *loader;
|
||||||
IDWriteFontFamily *family;
|
IDWriteFontFamily *family;
|
||||||
IDWriteFontFace *fontface;
|
IDWriteFontFace *fontface;
|
||||||
|
IDWriteFactory6 *factory6;
|
||||||
IDWriteFontFile *file;
|
IDWriteFontFile *file;
|
||||||
IDWriteFont *font;
|
IDWriteFont *font;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
@ -2585,15 +2588,48 @@ static void test_system_fontcollection(void)
|
||||||
todo_wine
|
todo_wine
|
||||||
ok(!!event, "Expected event handle.\n");
|
ok(!!event, "Expected event handle.\n");
|
||||||
|
|
||||||
|
model = IDWriteFontCollection3_GetFontFamilyModel(collection3);
|
||||||
|
ok(model == DWRITE_FONT_FAMILY_MODEL_WEIGHT_STRETCH_STYLE, "Unexpected model.\n");
|
||||||
|
|
||||||
IDWriteFontCollection3_Release(collection3);
|
IDWriteFontCollection3_Release(collection3);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
win_skip("IDWriteFontCollection3 is not supported.\n");
|
win_skip("IDWriteFontCollection3 is not supported.\n");
|
||||||
|
|
||||||
|
/* With specified family model. */
|
||||||
|
hr = IDWriteFactory_QueryInterface(factory, &IID_IDWriteFactory6, (void **)&factory6);
|
||||||
|
if (SUCCEEDED(hr))
|
||||||
|
{
|
||||||
|
IDWriteFontCollection2 *c2;
|
||||||
|
|
||||||
|
hr = IDWriteFactory6_GetSystemFontCollection(factory6, FALSE, DWRITE_FONT_FAMILY_MODEL_TYPOGRAPHIC,
|
||||||
|
&collection2);
|
||||||
|
todo_wine
|
||||||
|
ok(hr == S_OK, "Failed to get collection, hr %#x.\n", hr);
|
||||||
|
if (SUCCEEDED(hr))
|
||||||
|
{
|
||||||
|
hr = IDWriteFactory6_GetSystemFontCollection(factory6, FALSE, DWRITE_FONT_FAMILY_MODEL_TYPOGRAPHIC, &c2);
|
||||||
|
ok(hr == S_OK, "Failed to get collection, hr %#x.\n", hr);
|
||||||
|
ok(c2 == collection2 && collection != (IDWriteFontCollection *)c2, "Unexpected collection instance.\n");
|
||||||
|
IDWriteFontCollection2_Release(c2);
|
||||||
|
IDWriteFontCollection2_Release(collection2);
|
||||||
|
|
||||||
|
hr = IDWriteFactory6_GetSystemFontCollection(factory6, FALSE, DWRITE_FONT_FAMILY_MODEL_WEIGHT_STRETCH_STYLE,
|
||||||
|
&collection2);
|
||||||
|
ok(hr == S_OK, "Failed to get collection, hr %#x.\n", hr);
|
||||||
|
ok(collection == (IDWriteFontCollection *)collection2, "Unexpected instance.\n");
|
||||||
|
IDWriteFontCollection2_Release(collection2);
|
||||||
|
}
|
||||||
|
|
||||||
|
IDWriteFactory6_Release(factory6);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
win_skip("IDWriteFactory6 is not supported.\n");
|
||||||
|
|
||||||
ref = IDWriteFontCollection_Release(collection);
|
ref = IDWriteFontCollection_Release(collection);
|
||||||
ok(ref == 0, "collection not released, %u\n", ref);
|
ok(!ref, "Collection wasn't released, %u.\n", ref);
|
||||||
ref = IDWriteFactory_Release(factory);
|
ref = IDWriteFactory_Release(factory);
|
||||||
ok(ref == 0, "factory not released, %u\n", ref);
|
ok(!ref, "Factory wasn't released, %u.\n", ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void get_logfont_from_font(IDWriteFont *font, LOGFONTW *logfont)
|
static void get_logfont_from_font(IDWriteFont *font, LOGFONTW *logfont)
|
||||||
|
|
Loading…
Reference in New Issue