Introduce ANSI version of LOGFONT and associated structures

svn path=/trunk/; revision=4433
This commit is contained in:
Gé van Geldorp 2003-03-26 08:11:53 +00:00
parent 96719caa15
commit 52dfe36e11
7 changed files with 218 additions and 88 deletions

View file

@ -1857,7 +1857,7 @@ CopyMetaFileA(HMETAFILE, LPCSTR);
HFONT
STDCALL
CreateFontIndirectA(CONST LOGFONT *);
CreateFontIndirectA(CONST LOGFONTA *);
HDC
STDCALL
@ -1878,7 +1878,7 @@ DeviceCapabilitiesA(LPCSTR, LPCSTR, WORD,
int
STDCALL
EnumFontFamiliesExA(HDC, LPLOGFONT, FONTENUMEXPROC, LPARAM,DWORD);
EnumFontFamiliesExA(HDC, LPLOGFONTA, FONTENUMEXPROC, LPARAM,DWORD);
int
STDCALL

View file

@ -472,7 +472,7 @@ typedef struct {
LPCTSTR lpTemplateName;
} CHOOSECOLOR, *LPCHOOSECOLOR;
typedef struct tagLOGFONT {
typedef struct tagLOGFONTA {
LONG lfHeight;
LONG lfWidth;
LONG lfEscapement;
@ -486,8 +486,8 @@ typedef struct tagLOGFONT {
BYTE lfClipPrecision;
BYTE lfQuality;
BYTE lfPitchAndFamily;
TCHAR lfFaceName[LF_FACESIZE];
} LOGFONT, *LPLOGFONT, *PLOGFONT;
CHAR lfFaceName[LF_FACESIZE];
} LOGFONTA, *LPLOGFONTA, *PLOGFONTA;
typedef struct tagLOGFONTW {
LONG lfHeight;
@ -506,24 +506,61 @@ typedef struct tagLOGFONTW {
WCHAR lfFaceName[LF_FACESIZE];
} LOGFONTW, *LPLOGFONTW, *PLOGFONTW;
typedef struct {
#ifdef UNICODE
typedef LOGFONTW LOGFONT;
typedef LPLOGFONTW LPLOGFONT;
typedef PLOGFONTW PLOGFONT;
#else
typedef LOGFONTA LOGFONT;
typedef LPLOGFONTA LPLOGFONT;
typedef PLOGFONTA PLOGFONT;
#endif
typedef struct tagCHOOSEFONTA {
DWORD lStructSize;
HWND hwndOwner;
HDC hDC;
LPLOGFONT lpLogFont;
LPLOGFONTA lpLogFont;
INT iPointSize;
DWORD Flags;
DWORD rgbColors;
LPARAM lCustData;
LPCFHOOKPROC lpfnHook;
LPCTSTR lpTemplateName;
LPCSTR lpTemplateName;
HINSTANCE hInstance;
LPTSTR lpszStyle;
LPSTR lpszStyle;
WORD nFontType;
WORD ___MISSING_ALIGNMENT__;
INT nSizeMin;
INT nSizeMax;
} CHOOSEFONT, *LPCHOOSEFONT;
} CHOOSEFONTA, *LPCHOOSEFONTA;
typedef struct tagCHOOSEFONTW {
DWORD lStructSize;
HWND hwndOwner;
HDC hDC;
LPLOGFONTW lpLogFont;
INT iPointSize;
DWORD Flags;
DWORD rgbColors;
LPARAM lCustData;
LPCFHOOKPROC lpfnHook;
LPCWSTR lpTemplateName;
HINSTANCE hInstance;
LPWSTR lpszStyle;
WORD nFontType;
WORD ___MISSING_ALIGNMENT__;
INT nSizeMin;
INT nSizeMax;
} CHOOSEFONTW, *LPCHOOSEFONTW;
#ifdef UNICODE
typedef CHOOSEFONTW CHOOSEFONT;
typedef LPCHOOSEFONTW LPCHOOSEFONT;
#else
typedef CHOOSEFONTA CHOOSEFONT;
typedef LPCHOOSEFONTA LPCHOOSEFONT;
#endif
typedef struct _IDA {
UINT cidl;
@ -1283,24 +1320,45 @@ typedef struct tagPANOSE {
BYTE bXHeight;
} PANOSE;
typedef struct tagEXTLOGFONT {
LOGFONT elfLogFont;
typedef struct tagEXTLOGFONTA {
LOGFONTA elfLogFont;
BCHAR elfFullName[LF_FULLFACESIZE];
BCHAR elfStyle[LF_FACESIZE];
DWORD elfVersion;
DWORD elfStyleSize;
DWORD elfMatch;
DWORD elfReserved;
BYTE elfVendorId[ELF_VENDOR_SIZE];
DWORD elfCulture;
PANOSE elfPanose;
} EXTLOGFONT;
DWORD elfVersion;
DWORD elfStyleSize;
DWORD elfMatch;
DWORD elfReserved;
BYTE elfVendorId[ELF_VENDOR_SIZE];
DWORD elfCulture;
PANOSE elfPanose;
} EXTLOGFONTA, *LPEXTLOGFONTA;
typedef struct tagEXTLOGFONTW {
LOGFONTW elfLogFont;
WCHAR elfFullName[LF_FULLFACESIZE];
WCHAR elfStyle[LF_FACESIZE];
DWORD elfVersion;
DWORD elfStyleSize;
DWORD elfMatch;
DWORD elfReserved;
BYTE elfVendorId[ELF_VENDOR_SIZE];
DWORD elfCulture;
PANOSE elfPanose;
} EXTLOGFONTW, *LPEXTLOGFONTW;
#ifdef UNICODE
typedef EXTLOGFONTW EXTLOGFONT;
typedef LPEXTLOGFONTW LPEXTLOGFONT;
#else
typedef EXTLOGFONTA EXTLOGFONT;
typedef LPEXTLOGFONTA LPEXTLOGFONT;
#endif
typedef struct tagEMREXTCREATEFONTINDIRECTW
{
EMR emr;
DWORD ihFont;
EXTLOGFONT elfw;
EXTLOGFONTW elfw;
} EMREXTCREATEFONTINDIRECTW,
PEMREXTCREATEFONTINDIRECTW;
@ -1864,18 +1922,47 @@ typedef struct _ENUM_SERVICE_STATUSW {
#define LPENUM_SERVICE_STATUS LPENUM_SERVICE_STATUSA
#endif
typedef struct tagENUMLOGFONT {
LOGFONT elfLogFont;
typedef struct tagENUMLOGFONTA {
LOGFONTA elfLogFont;
BCHAR elfFullName[LF_FULLFACESIZE];
BCHAR elfStyle[LF_FACESIZE];
} ENUMLOGFONT;
} ENUMLOGFONTA, *LPENUMLOGFONTA;
typedef struct tagENUMLOGFONTEX {
LOGFONT elfLogFont;
BCHAR elfFullName[LF_FULLFACESIZE];
BCHAR elfStyle[LF_FACESIZE];
BCHAR elfScript[LF_FACESIZE];
} ENUMLOGFONTEX;
typedef struct tagENUMLOGFONTW {
LOGFONTW elfLogFont;
WCHAR elfFullName[LF_FULLFACESIZE];
WCHAR elfStyle[LF_FACESIZE];
} ENUMLOGFONTW, *LPENUMLOGFONTW;
#ifdef UNICODE
typedef ENUMLOGFONTW ENUMLOGFONT;
typedef LPENUMLOGFONTW LPENUMLOGFONT;
#else
typedef ENUMLOGFONTA ENUMLOGFONT;
typedef LPENUMLOGFONTA LPENUMLOGFONT;
#endif
typedef struct tagENUMLOGFONTEXA {
LOGFONTA elfLogFont;
BCHAR elfFullName[LF_FULLFACESIZE];
BCHAR elfStyle[LF_FACESIZE];
BCHAR elfScript[LF_FACESIZE];
} ENUMLOGFONTEXA, *LPENUMLOGFONTEXA;
typedef struct tagENUMLOGFONTEXW {
LOGFONTW elfLogFont;
WCHAR elfFullName[LF_FULLFACESIZE];
WCHAR elfStyle[LF_FACESIZE];
WCHAR elfScript[LF_FACESIZE];
} ENUMLOGFONTEXW, *LPENUMLOGFONTEXW;
#ifdef UNICODE
typedef ENUMLOGFONTEXW ENUMLOGFONTEX;
typedef LPENUMLOGFONTEXW LPENUMLOGFONTEX;
#else
typedef ENUMLOGFONTEXA ENUMLOGFONTEX;
typedef LPENUMLOGFONTEXA LPENUMLOGFONTEX;
#endif
typedef struct _EVENTLOGRECORD {
DWORD Length;
@ -2180,13 +2267,29 @@ typedef struct _ICONINFO {
HBITMAP hbmColor;
} ICONINFO, *PICONINFO;
typedef struct tagICONMETRICS {
UINT cbSize;
int iHorzSpacing;
int iVertSpacing;
int iTitleWrap;
LOGFONT lfFont;
} ICONMETRICS, *LPICONMETRICS;
typedef struct tagICONMETRICSA {
UINT cbSize;
int iHorzSpacing;
int iVertSpacing;
int iTitleWrap;
LOGFONTA lfFont;
} ICONMETRICSA, *LPICONMETRICSA;
typedef struct tagICONMETRICSW {
UINT cbSize;
int iHorzSpacing;
int iVertSpacing;
int iTitleWrap;
LOGFONTW lfFont;
} ICONMETRICSW, *LPICONMETRICSW;
#ifdef UNICODE
typedef ICONMETRICSW ICONMETRICS;
typedef LPICONMETRICSW LPICONMETRICS;
#else
typedef ICONMETRICSA ICONMETRICS;
typedef LPICONMETRICSA LPICONMETRICS;
#endif
typedef struct _IMAGEINFO {
HBITMAP hbmImage;
@ -2832,23 +2935,49 @@ typedef struct _NM_UPDOWN {
int iDelta;
} NM_UPDOWNW;
typedef struct tagNONCLIENTMETRICS {
UINT cbSize;
int iBorderWidth;
int iScrollWidth;
int iScrollHeight;
int iCaptionWidth;
int iCaptionHeight;
LOGFONT lfCaptionFont;
int iSmCaptionWidth;
int iSmCaptionHeight;
LOGFONT lfSmCaptionFont;
int iMenuWidth;
int iMenuHeight;
LOGFONT lfMenuFont;
LOGFONT lfStatusFont;
LOGFONT lfMessageFont;
} NONCLIENTMETRICS, * LPNONCLIENTMETRICS;
typedef struct tagNONCLIENTMETRICSA {
UINT cbSize;
int iBorderWidth;
int iScrollWidth;
int iScrollHeight;
int iCaptionWidth;
int iCaptionHeight;
LOGFONTA lfCaptionFont;
int iSmCaptionWidth;
int iSmCaptionHeight;
LOGFONTA lfSmCaptionFont;
int iMenuWidth;
int iMenuHeight;
LOGFONTA lfMenuFont;
LOGFONTA lfStatusFont;
LOGFONTA lfMessageFont;
} NONCLIENTMETRICSA, *LPNONCLIENTMETRICSA;
typedef struct tagNONCLIENTMETRICSW {
UINT cbSize;
int iBorderWidth;
int iScrollWidth;
int iScrollHeight;
int iCaptionWidth;
int iCaptionHeight;
LOGFONTW lfCaptionFont;
int iSmCaptionWidth;
int iSmCaptionHeight;
LOGFONTW lfSmCaptionFont;
int iMenuWidth;
int iMenuHeight;
LOGFONTW lfMenuFont;
LOGFONTW lfStatusFont;
LOGFONTW lfMessageFont;
} NONCLIENTMETRICSW, *LPNONCLIENTMETRICSW;
#ifdef UNICODE
typedef NONCLIENTMETRICSW NONCLIENTMETRICS;
typedef LPNONCLIENTMETRICSW LPNONCLIENTMETRICS;
#else
typedef NONCLIENTMETRICSA NONCLIENTMETRICS;
typedef LPNONCLIENTMETRICSA LPNONCLIENTMETRICS;
#endif
typedef struct _SERVICE_ADDRESS {
DWORD dwAddressType;
@ -4298,25 +4427,25 @@ typedef int CALLBACK (*ENUMMETAFILEPROC) (HDC, HANDLETABLE,
typedef int CALLBACK (*ENHMETAFILEPROC) (HDC, HANDLETABLE,
ENHMETARECORD, int, LPARAM);
typedef int CALLBACK (*ENUMFONTSPROCA) (LPLOGFONT, LPTEXTMETRICA, DWORD, LPARAM);
typedef int CALLBACK (*ENUMFONTSPROCW) (LPLOGFONT, LPTEXTMETRICW, DWORD, LPARAM);
typedef int CALLBACK (*ENUMFONTSPROCA) (LPLOGFONTA, LPTEXTMETRICA, DWORD, LPARAM);
typedef int CALLBACK (*ENUMFONTSPROCW) (LPLOGFONTW, LPTEXTMETRICW, DWORD, LPARAM);
#ifdef UNICODE
typedef ENUMFONTSPROCW ENUMFONTSPROC;
#else
typedef ENUMFONTSPROCA ENUMFONTSPROC;
#endif
typedef int CALLBACK (*FONTENUMPROCA) (ENUMLOGFONT *, NEWTEXTMETRICA *,
typedef int CALLBACK (*FONTENUMPROCA) (ENUMLOGFONTA *, NEWTEXTMETRICA *,
int, LPARAM);
typedef int CALLBACK (*FONTENUMPROCW) (ENUMLOGFONT *, NEWTEXTMETRICW *,
typedef int CALLBACK (*FONTENUMPROCW) (ENUMLOGFONTW *, NEWTEXTMETRICW *,
int, LPARAM);
#ifdef UNICODE
typedef FONTENUMPROCW FONTENUMPROC;
#else
typedef FONTENUMPROCA FONTENUMPROC;
#endif
typedef int CALLBACK (*FONTENUMEXPROCA) (ENUMLOGFONTEX *, NEWTEXTMETRICEXA *,
typedef int CALLBACK (*FONTENUMEXPROCA) (ENUMLOGFONTEXA *, NEWTEXTMETRICEXA *,
int, LPARAM);
typedef int CALLBACK (*FONTENUMEXPROCW) (ENUMLOGFONTEX *, NEWTEXTMETRICEXW *,
typedef int CALLBACK (*FONTENUMEXPROCW) (ENUMLOGFONTEXW *, NEWTEXTMETRICEXW *,
int, LPARAM);
#ifdef UNICODE
typedef FONTENUMEXPROCW FONTENUMEXPROC;

View file

@ -1858,7 +1858,7 @@ CopyMetaFileW(HMETAFILE, LPCWSTR);
HFONT
STDCALL
CreateFontIndirectW(CONST LOGFONT *);
CreateFontIndirectW(CONST LOGFONTW *);
HFONT
STDCALL
@ -1885,7 +1885,7 @@ DeviceCapabilitiesW(LPCWSTR, LPCWSTR, WORD,
int
STDCALL
EnumFontFamiliesExW(HDC, LPLOGFONT, FONTENUMEXPROC, LPARAM, DWORD);
EnumFontFamiliesExW(HDC, LPLOGFONTW, FONTENUMEXPROC, LPARAM, DWORD);
int
STDCALL

View file

@ -5,7 +5,8 @@
/* GDI logical font object */
typedef struct
{
LOGFONT logfont;
LOGFONTW logfont;
HFONT GDIFontHandle;
} TEXTOBJ, *PTEXTOBJ;
/* Internal interface */
@ -45,7 +46,7 @@ W32kCreateFont(int Height,
HFONT
STDCALL
W32kCreateFontIndirect(CONST LPLOGFONT lf);
W32kCreateFontIndirect(CONST LPLOGFONTW lf);
BOOL
STDCALL
@ -64,7 +65,7 @@ W32kEnumFontFamilies(HDC hDC,
int
STDCALL
W32kEnumFontFamiliesEx(HDC hDC,
LPLOGFONT Logfont,
LPLOGFONTW Logfont,
FONTENUMPROC EnumFontFamExProc,
LPARAM lParam,
DWORD Flags);

View file

@ -152,20 +152,20 @@ ExtTextOutW(
HFONT
STDCALL
CreateFontIndirectA(
CONST LOGFONT *lf
CONST LOGFONTA *lf
)
{
ANSI_STRING StringA;
UNICODE_STRING StringU;
HFONT ret;
LOGFONT tlf;
LOGFONTW tlf;
RtlInitAnsiString(&StringA, (LPSTR)lf->lfFaceName);
RtlAnsiStringToUnicodeString(&StringU, &StringA, TRUE);
memcpy(&tlf, lf, sizeof(LOGFONT));
memcpy(&tlf, lf, sizeof(LOGFONTA));
memcpy(&tlf.lfFaceName, &StringU.Buffer, StringU.Length);
ret = CreateFontIndirectW((CONST LOGFONT *)&lf);
ret = CreateFontIndirectW(&tlf);
RtlFreeUnicodeString(&StringU);
@ -175,10 +175,10 @@ CreateFontIndirectA(
HFONT
STDCALL
CreateFontIndirectW(
CONST LOGFONT *lf
CONST LOGFONTW *lf
)
{
return W32kCreateFontIndirect((CONST LPLOGFONT)lf);
return W32kCreateFontIndirect((CONST LPLOGFONTW)lf);
}
HFONT

View file

@ -1,7 +1,7 @@
/*
* GDIOBJ.C - GDI object manipulation routines
*
* $Id: gdiobj.c,v 1.21 2003/03/08 00:46:14 gvg Exp $
* $Id: gdiobj.c,v 1.22 2003/03/26 08:11:53 gvg Exp $
*
*/
@ -52,7 +52,7 @@ static LOGPEN BlackPen =
static LOGPEN NullPen =
{ PS_NULL, { 0, 0 }, 0 };
static LOGFONT OEMFixedFont =
static LOGFONTW OEMFixedFont =
{ 0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, OEM_CHARSET,
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, L"" };
@ -61,38 +61,38 @@ static LOGFONT OEMFixedFont =
segment, and (c) Solaris assembler is stupid. */
static UINT align_OEMFixedFont = 1;
static LOGFONT AnsiFixedFont =
static LOGFONTW AnsiFixedFont =
{ 0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, L"" };
static UINT align_AnsiFixedFont = 1;
static LOGFONT AnsiVarFont =
static LOGFONTW AnsiVarFont =
{ 0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS, L"MS Sans Serif" };
static UINT align_AnsiVarFont = 1;
static LOGFONT SystemFont =
static LOGFONTW SystemFont =
{ 0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS, L"System" };
static UINT align_SystemFont = 1;
static LOGFONT DeviceDefaultFont =
static LOGFONTW DeviceDefaultFont =
{ 0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS, L"" };
static UINT align_DeviceDefaultFont = 1;
static LOGFONT SystemFixedFont =
static LOGFONTW SystemFixedFont =
{ 0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, L"" };
static UINT align_SystemFixedFont = 1;
/* FIXME: Is this correct? */
static LOGFONT DefaultGuiFont =
static LOGFONTW DefaultGuiFont =
{ 0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS, L"MS Sans Serif" };

View file

@ -164,7 +164,7 @@ W32kCreateFont(int Height,
DWORD PitchAndFamily,
LPCWSTR Face)
{
LOGFONT logfont;
LOGFONTW logfont;
logfont.lfHeight = Height;
logfont.lfWidth = Width;
@ -183,14 +183,14 @@ W32kCreateFont(int Height,
if(Face)
memcpy(logfont.lfFaceName, Face, sizeof(logfont.lfFaceName));
else
logfont.lfFaceName[0] = '\0';
logfont.lfFaceName[0] = L'\0';
return W32kCreateFontIndirect(&logfont);
}
HFONT
STDCALL
W32kCreateFontIndirect(CONST LPLOGFONT lf)
W32kCreateFontIndirect(CONST LPLOGFONTW lf)
{
HFONT hFont = 0;
PTEXTOBJ fontPtr;
@ -202,7 +202,7 @@ W32kCreateFontIndirect(CONST LPLOGFONT lf)
fontPtr = TEXTOBJ_LockText( hFont );
ASSERT( fontPtr ); //I want to know when this happens
if( fontPtr ){
memcpy(&fontPtr->logfont, lf, sizeof(LOGFONT));
memcpy(&fontPtr->logfont, lf, sizeof(LOGFONTW));
if (lf->lfEscapement != lf->lfOrientation) {
/* this should really depend on whether GM_ADVANCED is set */
@ -230,7 +230,7 @@ int
STDCALL
W32kEnumFontFamilies(HDC hDC,
LPCWSTR Family,
FONTENUMPROC EnumFontFamProc,
FONTENUMPROCW EnumFontFamProc,
LPARAM lParam)
{
UNIMPLEMENTED;
@ -239,8 +239,8 @@ W32kEnumFontFamilies(HDC hDC,
int
STDCALL
W32kEnumFontFamiliesEx(HDC hDC,
LPLOGFONT Logfont,
FONTENUMPROC EnumFontFamExProc,
LPLOGFONTW Logfont,
FONTENUMPROCW EnumFontFamExProc,
LPARAM lParam,
DWORD Flags)
{
@ -251,7 +251,7 @@ int
STDCALL
W32kEnumFonts(HDC hDC,
LPCWSTR FaceName,
FONTENUMPROC FontFunc,
FONTENUMPROCW FontFunc,
LPARAM lParam)
{
UNIMPLEMENTED;
@ -612,7 +612,7 @@ W32kTextOut(HDC hDC,
for(i=0; i<FontsLoaded; i++)
{
if(wcscmp(FontTable[i].FaceName, (LPSTR)TextObj->logfont.lfFaceName) == 0)
if(wcscmp(FontTable[i].FaceName, TextObj->logfont.lfFaceName) == 0)
hFont = FontTable[i].hFont;
}