From 4ebdef9ff3266b2a280dba0bbacbe3cf1659c945 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Tue, 29 Mar 2011 13:11:53 -0500 Subject: [PATCH] gdiplus: Fall back to Liberation Serif if Times New Roman is missing. --- dlls/gdiplus/font.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index e092b43..54accd7 100644 --- a/dlls/gdiplus/font.c +++ b/dlls/gdiplus/font.c @@ -837,12 +837,22 @@ GpStatus WINGDIPAPI GdipGetGenericFontFamilyMonospace(GpFontFamily **nativeFamil GpStatus WINGDIPAPI GdipGetGenericFontFamilySerif(GpFontFamily **nativeFamily) { static const WCHAR TimesNewRoman[] = {'T','i','m','e','s',' ','N','e','w',' ','R','o','m','a','n','\0'}; + static const WCHAR LiberationSerif[] = {'L','i','b','e','r','a','t','i','o','n',' ','S','e','r','i','f','\0'}; + GpStatus stat; TRACE("(%p)\n", nativeFamily); if (nativeFamily == NULL) return InvalidParameter; - return GdipCreateFontFamilyFromName(TimesNewRoman, NULL, nativeFamily); + stat = GdipCreateFontFamilyFromName(TimesNewRoman, NULL, nativeFamily); + + if (stat == FontFamilyNotFound) + stat = GdipCreateFontFamilyFromName(LiberationSerif, NULL, nativeFamily); + + if (stat == FontFamilyNotFound) + ERR("Missing 'Times New Roman' font\n"); + + return stat; } /***************************************************************************** -- 1.7.2.5