Vincent Povirk : gdiplus: Ensure GdipGetGenericFontFamilySansSerif returns a truetype font.
Alexandre Julliard
julliard at winehq.org
Fri Apr 16 10:56:00 CDT 2010
Module: wine
Branch: master
Commit: 049aa8dacd8135ac11e9deee982c14959e9511fe
URL: http://source.winehq.org/git/wine.git/?a=commit;h=049aa8dacd8135ac11e9deee982c14959e9511fe
Author: Vincent Povirk <vincent at codeweavers.com>
Date: Thu Apr 15 11:40:21 2010 -0500
gdiplus: Ensure GdipGetGenericFontFamilySansSerif returns a truetype font.
---
dlls/gdiplus/font.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c
index 37cca71..0b7f9f6 100644
--- a/dlls/gdiplus/font.c
+++ b/dlls/gdiplus/font.c
@@ -829,15 +829,21 @@ GpStatus WINGDIPAPI GdipGetGenericFontFamilySerif(GpFontFamily **nativeFamily)
*/
GpStatus WINGDIPAPI GdipGetGenericFontFamilySansSerif(GpFontFamily **nativeFamily)
{
- /* FIXME: On Windows this is called Microsoft Sans Serif, this shouldn't
- * affect anything */
- static const WCHAR MSSansSerif[] = {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'};
+ GpStatus stat;
+ static const WCHAR MicrosoftSansSerif[] = {'M','i','c','r','o','s','o','f','t',' ','S','a','n','s',' ','S','e','r','i','f','\0'};
+ static const WCHAR Tahoma[] = {'T','a','h','o','m','a','\0'};
TRACE("(%p)\n", nativeFamily);
if (nativeFamily == NULL) return InvalidParameter;
- return GdipCreateFontFamilyFromName(MSSansSerif, NULL, nativeFamily);
+ stat = GdipCreateFontFamilyFromName(MicrosoftSansSerif, NULL, nativeFamily);
+
+ if (stat == FontFamilyNotFound)
+ /* FIXME: Microsoft Sans Serif is not installed on Wine. */
+ stat = GdipCreateFontFamilyFromName(Tahoma, NULL, nativeFamily);
+
+ return stat;
}
/*****************************************************************************
More information about the wine-cvs
mailing list