Evan Stade : gdiplus: Added GdipCreateFontFromLogfontA.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Aug 14 07:13:01 CDT 2007


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

Author: Evan Stade <estade at gmail.com>
Date:   Mon Aug 13 18:34:57 2007 -0700

gdiplus: Added GdipCreateFontFromLogfontA.

---

 dlls/gdiplus/font.c       |   19 +++++++++++++++++++
 dlls/gdiplus/gdiplus.spec |    2 +-
 include/gdiplusflat.h     |    1 +
 3 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c
index 2cd514d..d02b04d 100644
--- a/dlls/gdiplus/font.c
+++ b/dlls/gdiplus/font.c
@@ -21,6 +21,7 @@
 #include "windef.h"
 #include "winbase.h"
 #include "wingdi.h"
+#include "winnls.h"
 
 #include "objbase.h"
 
@@ -40,3 +41,21 @@ GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC hdc,
 
     return Ok;
 }
+
+GpStatus WINGDIPAPI GdipCreateFontFromLogfontA(HDC hdc,
+    GDIPCONST LOGFONTA *lfa, GpFont **font)
+{
+    LOGFONTW lfw;
+
+    if(!lfa || !font)
+        return InvalidParameter;
+
+    memcpy(&lfw, lfa, sizeof(LOGFONTA));
+
+    if(!MultiByteToWideChar(CP_ACP, 0, lfa->lfFaceName, -1, lfw.lfFaceName, LF_FACESIZE))
+        return GenericError;
+
+    GdipCreateFontFromLogfontW(hdc, &lfw, font);
+
+    return Ok;
+}
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index d311c45..39253a5 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -87,7 +87,7 @@
 @ stub GdipCreateFont
 @ stub GdipCreateFontFamilyFromName
 @ stub GdipCreateFontFromDC
-@ stub GdipCreateFontFromLogfontA
+@ stdcall GdipCreateFontFromLogfontA(ptr ptr ptr)
 @ stdcall GdipCreateFontFromLogfontW(ptr ptr ptr)
 @ stub GdipCreateFromHDC2
 @ stdcall GdipCreateFromHDC(long ptr)
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 05bf54e..ba2a3ca 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -236,6 +236,7 @@ GpStatus WINGDIPAPI GdipSetImageAttributesColorMatrix(GpImageAttributes*,
 GpStatus WINGDIPAPI GdipSetImageAttributesWrapMode(GpImageAttributes*,WrapMode,
     ARGB,BOOL);
 
+GpStatus WINGDIPAPI GdipCreateFontFromLogfontA(HDC,GDIPCONST LOGFONTA*,GpFont**);
 GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC,GDIPCONST LOGFONTW*,GpFont**);
 
 #ifdef __cplusplus




More information about the wine-cvs mailing list