gdiplus: Added font constructor.

oldstable
Evan Stade 2007-08-13 18:34:51 -07:00 committed by Alexandre Julliard
parent 9d6e0750f2
commit d060aeccca
6 changed files with 52 additions and 1 deletions

View File

@ -10,6 +10,7 @@ EXTRALIBS = -luuid
C_SRCS = \
brush.c \
customlinecap.c \
font.c \
gdiplus.c \
graphics.c \
graphicspath.c \

View File

@ -0,0 +1,42 @@
/*
* Copyright (C) 2007 Google (Evan Stade)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "objbase.h"
#include "gdiplus.h"
#include "gdiplus_private.h"
GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC hdc,
GDIPCONST LOGFONTW *logfont, GpFont **font)
{
if(!logfont || !font)
return InvalidParameter;
*font = GdipAlloc(sizeof(GpFont));
if(!*font) return OutOfMemory;
memcpy(&(*font)->lfw, logfont, sizeof(LOGFONTW));
return Ok;
}

View File

@ -88,7 +88,7 @@
@ stub GdipCreateFontFamilyFromName
@ stub GdipCreateFontFromDC
@ stub GdipCreateFontFromLogfontA
@ stub GdipCreateFontFromLogfontW
@ stdcall GdipCreateFontFromLogfontW(ptr ptr ptr)
@ stub GdipCreateFromHDC2
@ stdcall GdipCreateFromHDC(long ptr)
@ stdcall GdipCreateFromHWND(long ptr)

View File

@ -170,4 +170,8 @@ struct GpImageAttributes{
WrapMode wrap;
};
struct GpFont{
LOGFONTW lfw;
};
#endif

View File

@ -236,6 +236,8 @@ GpStatus WINGDIPAPI GdipSetImageAttributesColorMatrix(GpImageAttributes*,
GpStatus WINGDIPAPI GdipSetImageAttributesWrapMode(GpImageAttributes*,WrapMode,
ARGB,BOOL);
GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC,GDIPCONST LOGFONTW*,GpFont**);
#ifdef __cplusplus
}
#endif

View File

@ -36,6 +36,7 @@ class GpBitmap : public GpImage {};
class GpPathGradient : public GpBrush {};
class GpLineGradient : public GpBrush {};
class GpTexture : public GpBrush {};
class GpFont {};
#else /* end of c++ declarations */
@ -54,6 +55,7 @@ typedef struct GpBitmap GpBitmap;
typedef struct GpPathGradient GpPathGradient;
typedef struct GpLineGradient GpLineGradient;
typedef struct GpTexture GpTexture;
typedef struct GpFont GpFont;
#endif /* end of c declarations */