Signed-off-by: Shawn M. Chapla schapla@codeweavers.com --- dlls/gdiplus/metafile.c | 7 ++++++- dlls/gdiplus/tests/metafile.c | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/gdiplus/metafile.c b/dlls/gdiplus/metafile.c index cedffb23ca..d6bcbb5c12 100644 --- a/dlls/gdiplus/metafile.c +++ b/dlls/gdiplus/metafile.c @@ -2440,8 +2440,13 @@ static GpStatus METAFILE_PlaybackObject(GpMetafile *metafile, UINT flags, UINT d
status = GdipCreateFontFamilyFromName(familyname, NULL, &family); GdipFree(familyname); + + /* If a font family cannot be created from family name, native + falls back to a sans serif font. */ if (status != Ok) - return InvalidParameter; + status = GdipGetGenericFontFamilySansSerif(&family); + if (status != Ok) + return status;
status = GdipCreateFont(family, data->EmSize, data->FontStyleFlags, data->SizeUnit, (GpFont **)&object); GdipDeleteFontFamily(family); diff --git a/dlls/gdiplus/tests/metafile.c b/dlls/gdiplus/tests/metafile.c index 9fa60098e6..8179e1a5fd 100644 --- a/dlls/gdiplus/tests/metafile.c +++ b/dlls/gdiplus/tests/metafile.c @@ -3060,8 +3060,8 @@ static void test_drawdriverstring(void) static const emfplus_record unknownfontdecode_records[] = { { EMR_HEADER }, { EmfPlusRecordTypeHeader }, - { EmfPlusRecordTypeObject, ObjectTypeFont << 8, 0, 1 }, - { EmfPlusRecordTypeDrawDriverString, 0x8000, 0, 1 }, + { EmfPlusRecordTypeObject, ObjectTypeFont << 8 }, + { EmfPlusRecordTypeDrawDriverString, 0x8000 }, { EmfPlusRecordTypeEndOfFile }, { EMR_EOF }, { 0 }