Adam Petaccia : gdiplus: Implement GdipGetFontStyle.

Alexandre Julliard julliard at winehq.org
Thu Aug 28 07:00:46 CDT 2008


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

Author: Adam Petaccia <adam at tpetaccia.com>
Date:   Wed Aug 27 17:22:00 2008 -0400

gdiplus: Implement GdipGetFontStyle.

---

 dlls/gdiplus/font.c       |   31 +++++++++++++++++++++++++++++--
 dlls/gdiplus/tests/font.c |    3 ---
 2 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c
index f7638e7..9839a45 100644
--- a/dlls/gdiplus/font.c
+++ b/dlls/gdiplus/font.c
@@ -298,11 +298,38 @@ GpStatus WINGDIPAPI GdipGetFontSize(GpFont *font, REAL *size)
     return Ok;
 }
 
+/*******************************************************************************
+ * GdipGetFontStyle [GDIPLUS.@]
+ *
+ * Gets the font's style, returned in bitwise OR of FontStyle enumeration
+ *
+ * PARAMS
+ *  font    [I] font to request from
+ *  style   [O] resulting pointer to a FontStyle enumeration
+ *
+ * RETURNS
+ *  SUCCESS: Ok
+ *  FAILURE: InvalidParameter
+ */
 GpStatus WINGDIPAPI GdipGetFontStyle(GpFont *font, INT *style)
 {
-    FIXME("stub: %p %p\n", font, style);
+    TRACE("%p %p\n", font, style);
 
-    return NotImplemented;
+    if (!(font && style))
+        return InvalidParameter;
+
+    if (font->lfw.lfWeight > 400)
+        *style = FontStyleBold;
+    else
+        *style = 0;
+    if (font->lfw.lfItalic)
+        *style |= FontStyleItalic;
+    if (font->lfw.lfUnderline)
+        *style |= FontStyleUnderline;
+    if (font->lfw.lfStrikeOut)
+        *style |= FontStyleStrikeout;
+
+    return Ok;
 }
 
 /*******************************************************************************
diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c
index c0658c2..b396141 100644
--- a/dlls/gdiplus/tests/font.c
+++ b/dlls/gdiplus/tests/font.c
@@ -172,13 +172,10 @@ todo_wine {
     expect(0, lfw2.lfQuality);
     expect(0, lfw2.lfPitchAndFamily);
 
-todo_wine
-{
     stat = GdipGetFontStyle(font, &style);
     expect(Ok, stat);
     ok (style == (FontStyleItalic | FontStyleUnderline | FontStyleStrikeout),
             "Expected , got %d\n", style);
-}
 
     GdipDeleteFont(font);
 




More information about the wine-cvs mailing list