Francois Gouget : gdiplus: Use Liberation Mono as a fallback for Courier New for the monospace family .

Alexandre Julliard julliard at winehq.org
Tue Sep 13 12:18:09 CDT 2011


Module: wine
Branch: master
Commit: 4c13e84a7c5a69f1040fe6a347d3f819fbbf1146
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4c13e84a7c5a69f1040fe6a347d3f819fbbf1146

Author: Francois Gouget <fgouget at free.fr>
Date:   Tue Sep 13 01:47:27 2011 +0200

gdiplus: Use Liberation Mono as a fallback for Courier New for the monospace family.

---

 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 3624391..169e28f 100644
--- a/dlls/gdiplus/font.c
+++ b/dlls/gdiplus/font.c
@@ -816,10 +816,20 @@ GpStatus WINGDIPAPI GdipIsStyleAvailable(GDIPCONST GpFontFamily* family,
 GpStatus WINGDIPAPI GdipGetGenericFontFamilyMonospace(GpFontFamily **nativeFamily)
 {
     static const WCHAR CourierNew[] = {'C','o','u','r','i','e','r',' ','N','e','w','\0'};
+    static const WCHAR LiberationMono[] = {'L','i','b','e','r','a','t','i','o','n',' ','M','o','n','o','\0'};
+    GpStatus stat;
 
     if (nativeFamily == NULL) return InvalidParameter;
 
-    return GdipCreateFontFamilyFromName(CourierNew, NULL, nativeFamily);
+    stat = GdipCreateFontFamilyFromName(CourierNew, NULL, nativeFamily);
+
+    if (stat == FontFamilyNotFound)
+        stat = GdipCreateFontFamilyFromName(LiberationMono, NULL, nativeFamily);
+
+    if (stat == FontFamilyNotFound)
+        ERR("Missing 'Courier New' font\n");
+
+    return stat;
 }
 
 /*****************************************************************************




More information about the wine-cvs mailing list