From 082529b1bf0849aaa9d74d5441b2d8672c4878a1 Mon Sep 17 00:00:00 2001 From: Adam Petaccia <adam@tpetaccia.com> Date: Sat, 21 Jun 2008 13:02:55 -0400 Subject: [PATCH] gdiplus: Implement GdipGetFontSize. --- dlls/gdiplus/font.c | 25 +++++++++++++++++++++++++ dlls/gdiplus/gdiplus.spec | 2 +- include/gdiplusflat.h | 1 + 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index cdfd7f25bbd..0bb9fc7cda5 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 9950c0f9c70..dd98c5058bc 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 a3a12f3af65..b6150949d3f 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**); -- GitLab