Commit 9ec6fd85 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Return CreateStreamFromKey() failure code from Analyze().

parent 8abed244
......@@ -1715,10 +1715,12 @@ HRESULT create_font_collection(IDWriteFactory2* factory, IDWriteFontFileEnumerat
if (FAILED(hr))
break;
/* failed font files are skipped */
hr = IDWriteFontFile_Analyze(file, &supported, &file_type, &face_type, &face_count);
if (FAILED(hr) || !supported || face_count == 0) {
TRACE("unsupported font (0x%08x, %d, %u)\n", hr, supported, face_count);
TRACE("unsupported font (%p, 0x%08x, %d, %u)\n", file, hr, supported, face_count);
IDWriteFontFile_Release(file);
hr = S_OK;
continue;
}
......@@ -2080,7 +2082,7 @@ static HRESULT WINAPI dwritefontfile_Analyze(IDWriteFontFile *iface, BOOL *isSup
hr = IDWriteFontFileLoader_CreateStreamFromKey(This->loader, This->reference_key, This->key_size, &stream);
if (FAILED(hr))
return S_OK;
return hr;
hr = opentype_analyze_font(stream, numberOfFaces, fontFileType, fontFaceType, isSupportedFontType);
......
......@@ -1814,15 +1814,14 @@ static void test_CreateCustomFontFileReference(void)
face_type = DWRITE_FONT_FACE_TYPE_TRUETYPE;
support = TRUE;
count = 1;
IDWriteFontFile_Analyze(file, &support, &file_type, &face_type, &count);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IDWriteFontFile_Analyze(file, &support, &file_type, &face_type, &count);
ok(hr == 0x8faecafe, "got 0x%08x\n", hr);
ok(support == FALSE, "got %i\n", support);
ok(file_type == DWRITE_FONT_FILE_TYPE_UNKNOWN, "got %i\n", file_type);
ok(face_type == DWRITE_FONT_FACE_TYPE_UNKNOWN, "got %i\n", face_type);
ok(count == 0, "got %i\n", count);
hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_CFF, 1, &file, 0, 0, &face);
todo_wine
ok(hr == 0x8faecafe, "got 0x%08x\n", hr);
IDWriteFontFile_Release(file);
......
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