From 1919b124a2ab49182bb96f2ecd4b43e870d1ab93 Mon Sep 17 00:00:00 2001
From: Adam Petaccia <adam@tpetaccia.com>
Date: Sat, 21 Jun 2008 13:02:54 -0400
Subject: [PATCH] gdiplus: Implement GdipGetFontUnit.

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

diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c
index 97623561990..cdfd7f25bbd 100644
--- a/dlls/gdiplus/font.c
+++ b/dlls/gdiplus/font.c
@@ -236,6 +236,26 @@ GpStatus WINGDIPAPI GdipCreateFontFromDC(HDC hdc, GpFont **font)
     return GdipCreateFontFromLogfontW(hdc, &lfw, font);
 }
 
+/*******************************************************************************
+ * GdipGetFontUnit  [GDIPLUS.@]
+ *
+ * PARAMS
+ *  font    [I] Font to retrieve from
+ *  unit    [O] Return value
+ *
+ * RETURNS
+ *  FAILURE: font or unit was NULL
+ *  OK: otherwise
+ */
+GpStatus WINGDIPAPI GdipGetFontUnit(GpFont *font, Unit *unit)
+{
+    if (!(font && unit)) return InvalidParameter;
+
+    *unit = font->unit;
+
+    return Ok;
+}
+
 /* FIXME: use graphics */
 GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics,
     LOGFONTW *lfw)
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index f43a63e8c1f..9950c0f9c70 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -271,7 +271,7 @@
 @ stub GdipGetFontHeightGivenDPI
 @ stub GdipGetFontSize
 @ stub GdipGetFontStyle
-@ stub GdipGetFontUnit
+@ stdcall GdipGetFontUnit(ptr ptr)
 @ stdcall GdipGetGenericFontFamilyMonospace(ptr)
 @ stdcall GdipGetGenericFontFamilySansSerif(ptr)
 @ stdcall GdipGetGenericFontFamilySerif(ptr)
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index a8caf9bb334..a3a12f3af65 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -349,6 +349,7 @@ GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC,GDIPCONST LOGFONTW*,GpFont**)
 GpStatus WINGDIPAPI GdipDeleteFont(GpFont*);
 GpStatus WINGDIPAPI GdipGetLogFontW(GpFont*,GpGraphics*,LOGFONTW*);
 GpStatus WINGDIPAPI GdipCloneFont(GpFont*,GpFont**);
+GpStatus WINGDIPAPI GdipGetFontUnit(GpFont*, Unit*);
 
 GpStatus WINGDIPAPI GdipCreateFontFamilyFromName(GDIPCONST WCHAR*,
     GpFontCollection*, GpFontFamily**);
-- 
GitLab