[PATCH] 1/4 Implement GdipGetGenericFontFamilyMonospace

Adam Petaccia adam at tpetaccia.com
Tue Jun 17 09:56:36 CDT 2008


---
 dlls/gdiplus/font.c       |   20 ++++++++++++++++++++
 dlls/gdiplus/gdiplus.spec |    2 +-
 include/gdiplusflat.h     |    2 ++
 3 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c
index 4e1d527..11443b7 100644
--- a/dlls/gdiplus/font.c
+++ b/dlls/gdiplus/font.c
@@ -260,3 +260,23 @@ GpStatus WINGDIPAPI GdipDeleteFontFamily(GpFontFamily *FontFamily)
 
     return Ok;
 }
+
+/*****************************************************************************
+ *         GdipGetGenericFontFamilyMonospace   [GDIPLUS.@]
+ * Obtains a serif family (Courier New on Windows)
+ *
+ * PARAMS:
+ *  **nativeFamily         [I] Where the font will be stored
+ *
+ * RETURNS:
+ *  InvalidParameter if nativeFamily is NULL.
+ *  Ok otherwise.
+ */
+GpStatus WINGDIPAPI GdipGetGenericFontFamilyMonospace(GpFontFamily **nativeFamily)
+{
+    static const WCHAR CourierNew[] = {'C','o','u','r','i','e','r',' ','N','e','w','\0'};
+
+    if (nativeFamily == NULL) return InvalidParameter;
+
+    return GdipCreateFontFamilyFromName(CourierNew, NULL, nativeFamily);
+}
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 4836ca9..a932ff4 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -272,7 +272,7 @@
 @ stub GdipGetFontSize
 @ stub GdipGetFontStyle
 @ stub GdipGetFontUnit
-@ stub GdipGetGenericFontFamilyMonospace
+@ stdcall GdipGetGenericFontFamilyMonospace(ptr)
 @ stub GdipGetGenericFontFamilySansSerif
 @ stub GdipGetGenericFontFamilySerif
 @ stub GdipGetHatchBackgroundColor
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index dd9ca72..5059aaf 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -348,6 +348,8 @@ GpStatus WINGDIPAPI GdipCreateFontFamilyFromName(GDIPCONST WCHAR *name, GpFontCo
 GpStatus WINGDIPAPI GdipDeleteFontFamily(GpFontFamily *FontFamily);
 GpStatus WINGDIPAPI GdipGetFamilyName(GDIPCONST GpFontFamily *family, WCHAR name[LF_FACESIZE], LANGID language);
 
+GpStatus WINGDIPAPI GdipGetGenericFontFamilyMonospace(GpFontFamily **nativeFamily);
+
 GpStatus WINGDIPAPI GdipCreateStringFormat(INT,LANGID,GpStringFormat**);
 GpStatus WINGDIPAPI GdipDeleteStringFormat(GpStringFormat*);
 GpStatus WINGDIPAPI GdipGetStringFormatAlign(GpStringFormat*,StringAlignment*);
-- 
1.5.4.3




More information about the wine-patches mailing list