Shawn M. Chapla : gdiplus: Use GenericFontFamilySansSerif when missing deserialized font family.

Alexandre Julliard julliard at winehq.org
Mon Jul 20 15:30:08 CDT 2020


Module: wine
Branch: master
Commit: a9151e2e2bf113fb3ad9a0a27ee8302a0dc5b3a4
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a9151e2e2bf113fb3ad9a0a27ee8302a0dc5b3a4

Author: Shawn M. Chapla <schapla at codeweavers.com>
Date:   Fri Jul 17 20:50:51 2020 -0400

gdiplus: Use GenericFontFamilySansSerif when missing deserialized font family.

Signed-off-by: Shawn M. Chapla <schapla at codeweavers.com>
Signed-off-by: Esme Povirk <esme at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 }




More information about the wine-cvs mailing list