diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index cdfd7f25bbd3e37585e7bacdc623ec16ba5932b2..0bb9fc7cda59fd711cdeac869f1f1a56f2cfdb70 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 9950c0f9c70373fc71ed705aa12fbb72a4c08c01..dd98c5058bc5aaf24985dbd2b2de575d0b697b2b 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 a3a12f3af65fdb0e90d9ff9c112fd3396795888b..b6150949d3f9268548bcdfff10d6961b9c827a34 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**);