Nikolay Sivov : gdiplus: Implemented GdipCreateFontFromDC.

Alexandre Julliard julliard at winehq.org
Thu May 1 06:38:35 CDT 2008


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

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Wed Apr 30 18:19:42 2008 +0400

gdiplus: Implemented GdipCreateFontFromDC.

---

 dlls/gdiplus/font.c       |   18 ++++++++++++++++++
 dlls/gdiplus/gdiplus.spec |    6 +++---
 include/gdiplusflat.h     |    1 +
 3 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c
index d5d7e94..a05ef75 100644
--- a/dlls/gdiplus/font.c
+++ b/dlls/gdiplus/font.c
@@ -88,6 +88,24 @@ GpStatus WINGDIPAPI GdipDeleteFont(GpFont* font)
     return Ok;
 }
 
+GpStatus WINGDIPAPI GdipCreateFontFromDC(HDC hdc, GpFont **font)
+{
+    HFONT hfont;
+    LOGFONTW lfw;
+
+    if(!font)
+        return InvalidParameter;
+
+    hfont = (HFONT)GetCurrentObject(hdc, OBJ_FONT);
+    if(!hfont)
+        return GenericError;
+
+    if(!GetObjectW(hfont, sizeof(LOGFONTW), &lfw))
+        return GenericError;
+
+    return GdipCreateFontFromLogfontW(hdc, &lfw, font);
+}
+
 /* 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 bfab487..ec3897a 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -86,9 +86,9 @@
 @ stub GdipCreateEffect
 @ stub GdipCreateFont
 @ stub GdipCreateFontFamilyFromName
-@ stub GdipCreateFontFromDC
-@ stdcall GdipCreateFontFromLogfontA(ptr ptr ptr)
-@ stdcall GdipCreateFontFromLogfontW(ptr ptr ptr)
+@ stdcall GdipCreateFontFromDC(long ptr)
+@ stdcall GdipCreateFontFromLogfontA(long ptr ptr)
+@ stdcall GdipCreateFontFromLogfontW(long ptr ptr)
 @ stdcall GdipCreateFromHDC2(long long ptr)
 @ stdcall GdipCreateFromHDC(long ptr)
 @ stdcall GdipCreateFromHWND(long ptr)
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 2cecd99..ddd4914 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -330,6 +330,7 @@ GpStatus WINGDIPAPI GdipSetImageAttributesColorMatrix(GpImageAttributes*,
 GpStatus WINGDIPAPI GdipSetImageAttributesWrapMode(GpImageAttributes*,WrapMode,
     ARGB,BOOL);
 
+GpStatus WINGDIPAPI GdipCreateFontFromDC(HDC,GpFont**);
 GpStatus WINGDIPAPI GdipCreateFontFromLogfontA(HDC,GDIPCONST LOGFONTA*,GpFont**);
 GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC,GDIPCONST LOGFONTW*,GpFont**);
 GpStatus WINGDIPAPI GdipDeleteFont(GpFont*);




More information about the wine-cvs mailing list