Adam Petaccia : gdiplus: Implement GdipGetFontSize.

Alexandre Julliard julliard at winehq.org
Wed Jun 25 16:44:35 CDT 2008


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

Author: Adam Petaccia <adam at tpetaccia.com>
Date:   Sat Jun 21 13:02:55 2008 -0400

gdiplus: Implement GdipGetFontSize.

---

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

diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c
index cdfd7f2..0bb9fc7 100644
--- a/dlls/gdiplus/font.c
+++ b/dlls/gdiplus/font.c
@@ -236,6 +236,31 @@ GpStatus WINGDIPAPI GdipCreateFontFromDC(HDC hdc, GpFont **font)
     return GdipCreateFontFromLogfontW(hdc, &lfw, font);
 }
 
+/******************************************************************************
+ * GdipGetFontSize [GDIPLUS.@]
+ *
+ * Returns the size of the font in Units
+ *
+ * PARAMS
+ *  *font       [I] The font to retrieve size from
+ *  *size       [O] Pointer to hold retrieved value
+ *
+ * RETURNS
+ *  SUCCESS: Ok
+ *  FAILURE: InvalidParamter (font or size was NULL)
+ *
+ * NOTES
+ *  Size returned is actually emSize -- not internal size used for drawing.
+ */
+GpStatus WINGDIPAPI GdipGetFontSize(GpFont *font, REAL *size)
+{
+    if (!(font && size)) return InvalidParameter;
+
+    *size = font->emSize;
+
+    return Ok;
+}
+
 /*******************************************************************************
  * GdipGetFontUnit  [GDIPLUS.@]
  *
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 9950c0f..dd98c50 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -269,7 +269,7 @@
 @ stub GdipGetFontCollectionFamilyList
 @ stub GdipGetFontHeight
 @ stub GdipGetFontHeightGivenDPI
-@ stub GdipGetFontSize
+@ stdcall GdipGetFontSize(ptr ptr)
 @ stub GdipGetFontStyle
 @ stdcall GdipGetFontUnit(ptr ptr)
 @ stdcall GdipGetGenericFontFamilyMonospace(ptr)
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index a3a12f3..b615094 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -350,6 +350,7 @@ GpStatus WINGDIPAPI GdipDeleteFont(GpFont*);
 GpStatus WINGDIPAPI GdipGetLogFontW(GpFont*,GpGraphics*,LOGFONTW*);
 GpStatus WINGDIPAPI GdipCloneFont(GpFont*,GpFont**);
 GpStatus WINGDIPAPI GdipGetFontUnit(GpFont*, Unit*);
+GpStatus WINGDIPAPI GdipGetFontSize(GpFont*, REAL*);
 
 GpStatus WINGDIPAPI GdipCreateFontFamilyFromName(GDIPCONST WCHAR*,
     GpFontCollection*, GpFontFamily**);




More information about the wine-cvs mailing list