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

dwrite: Update to IDWriteFontFallback1.

parent 28dc5ff1
...@@ -256,8 +256,8 @@ extern HRESULT get_family_names_from_stream(IDWriteFontFileStream*,UINT32,DWRITE ...@@ -256,8 +256,8 @@ extern HRESULT get_family_names_from_stream(IDWriteFontFileStream*,UINT32,DWRITE
extern HRESULT create_colorglyphenum(FLOAT,FLOAT,const DWRITE_GLYPH_RUN*,const DWRITE_GLYPH_RUN_DESCRIPTION*,DWRITE_MEASURING_MODE, extern HRESULT create_colorglyphenum(FLOAT,FLOAT,const DWRITE_GLYPH_RUN*,const DWRITE_GLYPH_RUN_DESCRIPTION*,DWRITE_MEASURING_MODE,
const DWRITE_MATRIX*,UINT32,IDWriteColorGlyphRunEnumerator**) DECLSPEC_HIDDEN; const DWRITE_MATRIX*,UINT32,IDWriteColorGlyphRunEnumerator**) DECLSPEC_HIDDEN;
extern BOOL lb_is_newline_char(WCHAR) DECLSPEC_HIDDEN; extern BOOL lb_is_newline_char(WCHAR) DECLSPEC_HIDDEN;
extern HRESULT create_system_fontfallback(IDWriteFactory5*,IDWriteFontFallback**) DECLSPEC_HIDDEN; extern HRESULT create_system_fontfallback(IDWriteFactory5 *factory, IDWriteFontFallback1 **fallback) DECLSPEC_HIDDEN;
extern void release_system_fontfallback(IDWriteFontFallback*) DECLSPEC_HIDDEN; extern void release_system_fontfallback(IDWriteFontFallback1 *fallback) DECLSPEC_HIDDEN;
extern HRESULT create_fontfallback_builder(IDWriteFactory5*,IDWriteFontFallbackBuilder**) DECLSPEC_HIDDEN; extern HRESULT create_fontfallback_builder(IDWriteFactory5*,IDWriteFontFallbackBuilder**) DECLSPEC_HIDDEN;
extern HRESULT create_matching_font(IDWriteFontCollection*,const WCHAR*,DWRITE_FONT_WEIGHT,DWRITE_FONT_STYLE,DWRITE_FONT_STRETCH, extern HRESULT create_matching_font(IDWriteFontCollection*,const WCHAR*,DWRITE_FONT_WEIGHT,DWRITE_FONT_STYLE,DWRITE_FONT_STRETCH,
IDWriteFont**) DECLSPEC_HIDDEN; IDWriteFont**) DECLSPEC_HIDDEN;
......
...@@ -547,14 +547,15 @@ struct fileloader ...@@ -547,14 +547,15 @@ struct fileloader
IDWriteFontFileLoader *loader; IDWriteFontFileLoader *loader;
}; };
struct dwritefactory { struct dwritefactory
{
IDWriteFactory5 IDWriteFactory5_iface; IDWriteFactory5 IDWriteFactory5_iface;
LONG ref; LONG ref;
IDWriteFontCollection1 *system_collection; IDWriteFontCollection1 *system_collection;
IDWriteFontCollection1 *eudc_collection; IDWriteFontCollection1 *eudc_collection;
IDWriteGdiInterop1 *gdiinterop; IDWriteGdiInterop1 *gdiinterop;
IDWriteFontFallback *fallback; IDWriteFontFallback1 *fallback;
IDWriteFontFileLoader *localfontfileloader; IDWriteFontFileLoader *localfontfileloader;
struct list localfontfaces; struct list localfontfaces;
...@@ -1333,19 +1334,20 @@ static HRESULT WINAPI dwritefactory1_CreateCustomRenderingParams(IDWriteFactory5 ...@@ -1333,19 +1334,20 @@ static HRESULT WINAPI dwritefactory1_CreateCustomRenderingParams(IDWriteFactory5
static HRESULT WINAPI dwritefactory2_GetSystemFontFallback(IDWriteFactory5 *iface, IDWriteFontFallback **fallback) static HRESULT WINAPI dwritefactory2_GetSystemFontFallback(IDWriteFactory5 *iface, IDWriteFontFallback **fallback)
{ {
struct dwritefactory *This = impl_from_IDWriteFactory5(iface); struct dwritefactory *factory = impl_from_IDWriteFactory5(iface);
TRACE("(%p)->(%p)\n", This, fallback); TRACE("%p, %p.\n", iface, fallback);
*fallback = NULL; *fallback = NULL;
if (!This->fallback) { if (!factory->fallback)
HRESULT hr = create_system_fontfallback(iface, &This->fallback); {
HRESULT hr = create_system_fontfallback(iface, &factory->fallback);
if (FAILED(hr)) if (FAILED(hr))
return hr; return hr;
} }
*fallback = This->fallback; *fallback = (IDWriteFontFallback *)factory->fallback;
IDWriteFontFallback_AddRef(*fallback); IDWriteFontFallback_AddRef(*fallback);
return S_OK; return S_OK;
} }
......
...@@ -4704,6 +4704,7 @@ static void test_FontFallbackBuilder(void) ...@@ -4704,6 +4704,7 @@ static void test_FontFallbackBuilder(void)
static const WCHAR strW[] = {'A',0}; static const WCHAR strW[] = {'A',0};
IDWriteFontFallback *fallback, *fallback2; IDWriteFontFallback *fallback, *fallback2;
IDWriteFontFallbackBuilder *builder; IDWriteFontFallbackBuilder *builder;
IDWriteFontFallback1 *fallback1;
DWRITE_UNICODE_RANGE range; DWRITE_UNICODE_RANGE range;
IDWriteFactory2 *factory2; IDWriteFactory2 *factory2;
IDWriteFactory *factory; IDWriteFactory *factory;
...@@ -4891,6 +4892,13 @@ todo_wine { ...@@ -4891,6 +4892,13 @@ todo_wine {
if (font) if (font)
IDWriteFont_Release(font); IDWriteFont_Release(font);
if (SUCCEEDED(IDWriteFontFallback_QueryInterface(fallback, &IID_IDWriteFontFallback1, (void **)&fallback1)))
{
IDWriteFontFallback1_Release(fallback1);
}
else
win_skip("IDWriteFontFallback1 is not supported.\n");
IDWriteFontFallback_Release(fallback); IDWriteFontFallback_Release(fallback);
IDWriteFontFallbackBuilder_Release(builder); IDWriteFontFallbackBuilder_Release(builder);
...@@ -4902,6 +4910,7 @@ static void test_fallback(void) ...@@ -4902,6 +4910,7 @@ static void test_fallback(void)
{ {
static const WCHAR strW[] = {'a','b','c','d',0}; static const WCHAR strW[] = {'a','b','c','d',0};
IDWriteFontFallback *fallback, *fallback2; IDWriteFontFallback *fallback, *fallback2;
IDWriteFontFallback1 *fallback1;
DWRITE_CLUSTER_METRICS clusters[4]; DWRITE_CLUSTER_METRICS clusters[4];
DWRITE_TEXT_METRICS metrics; DWRITE_TEXT_METRICS metrics;
IDWriteTextLayout2 *layout2; IDWriteTextLayout2 *layout2;
...@@ -5002,6 +5011,13 @@ todo_wine { ...@@ -5002,6 +5011,13 @@ todo_wine {
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
ok(fallback2 == NULL, "got %p\n", fallback2); ok(fallback2 == NULL, "got %p\n", fallback2);
if (SUCCEEDED(IDWriteFontFallback_QueryInterface(fallback, &IID_IDWriteFontFallback1, (void **)&fallback1)))
{
IDWriteFontFallback1_Release(fallback1);
}
else
win_skip("IDWriteFontFallback1 is not supported.\n");
IDWriteFontFallback_Release(fallback); IDWriteFontFallback_Release(fallback);
IDWriteTextFormat1_Release(format1); IDWriteTextFormat1_Release(format1);
IDWriteTextLayout2_Release(layout2); IDWriteTextLayout2_Release(layout2);
......
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