Change FONTOBJ to use LOGFONTW rather than LOGFONT16.

Updated parameters of DEVICEFONTENUMPROC.
This commit is contained in:
Huw D M Davies 2001-02-14 22:56:38 +00:00 committed by Alexandre Julliard
parent 1da348910e
commit 2aa85eed18
12 changed files with 528 additions and 356 deletions

View File

@ -18,11 +18,11 @@ DEFAULT_DEBUG_CHANNEL(psdrv);
* PSDRV_FONT_SelectObject
*/
HFONT16 PSDRV_FONT_SelectObject( DC * dc, HFONT16 hfont,
FONTOBJ *font )
FONTOBJ *font )
{
HFONT16 prevfont = dc->hFont;
PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
LOGFONT16 *lf = &(font->logfont);
LOGFONTW *lf = &(font->logfont);
BOOL bd = FALSE, it = FALSE;
AFMLISTENTRY *afmle;
AFM *afm;
@ -30,8 +30,9 @@ HFONT16 PSDRV_FONT_SelectObject( DC * dc, HFONT16 hfont,
char FaceName[LF_FACESIZE];
TRACE("FaceName = '%s' Height = %d Italic = %d Weight = %d\n",
lf->lfFaceName, lf->lfHeight, lf->lfItalic, lf->lfWeight);
TRACE("FaceName = '%s' Height = %ld Italic = %d Weight = %ld\n",
debugstr_w(lf->lfFaceName), lf->lfHeight, lf->lfItalic,
lf->lfWeight);
dc->hFont = hfont;
@ -39,7 +40,8 @@ HFONT16 PSDRV_FONT_SelectObject( DC * dc, HFONT16 hfont,
it = TRUE;
if(lf->lfWeight > 550)
bd = TRUE;
strcpy(FaceName, lf->lfFaceName);
WideCharToMultiByte(CP_ACP, 0, lf->lfFaceName, -1,
FaceName, sizeof(FaceName), NULL, NULL);
if(FaceName[0] == '\0') {
switch(lf->lfPitchAndFamily & 0xf0) {
@ -270,8 +272,8 @@ BOOL PSDRV_SetFont( DC *dc )
/***********************************************************************
* PSDRV_GetFontMetric
*/
static UINT PSDRV_GetFontMetric(HDC hdc, AFM *pafm, NEWTEXTMETRIC16 *pTM,
ENUMLOGFONTEX16 *pLF, INT16 size)
static UINT PSDRV_GetFontMetric(HDC hdc, AFM *pafm, NEWTEXTMETRICEXW *pTM,
ENUMLOGFONTEXW *pLF, INT16 size)
{
DC *dc = DC_GetDCPtr( hdc );
@ -282,52 +284,55 @@ static UINT PSDRV_GetFontMetric(HDC hdc, AFM *pafm, NEWTEXTMETRIC16 *pTM,
memset( pLF, 0, sizeof(*pLF) );
memset( pTM, 0, sizeof(*pTM) );
#define plf ((LPLOGFONT16)pLF)
plf->lfHeight = pTM->tmHeight = size;
plf->lfWidth = pTM->tmAveCharWidth = pafm->CharWidths[120] * scale;
plf->lfWeight = pTM->tmWeight = pafm->Weight;
plf->lfItalic = pTM->tmItalic = pafm->ItalicAngle != 0.0;
plf->lfUnderline = pTM->tmUnderlined = 0;
plf->lfStrikeOut = pTM->tmStruckOut = 0;
plf->lfCharSet = pTM->tmCharSet = ANSI_CHARSET;
#define plf ((LPLOGFONTW)pLF)
#define ptm ((LPNEWTEXTMETRICW)pTM)
plf->lfHeight = ptm->tmHeight = size;
plf->lfWidth = ptm->tmAveCharWidth = pafm->CharWidths[120] * scale;
plf->lfWeight = ptm->tmWeight = pafm->Weight;
plf->lfItalic = ptm->tmItalic = pafm->ItalicAngle != 0.0;
plf->lfUnderline = ptm->tmUnderlined = 0;
plf->lfStrikeOut = ptm->tmStruckOut = 0;
plf->lfCharSet = ptm->tmCharSet = ANSI_CHARSET;
/* convert pitch values */
pTM->tmPitchAndFamily = pafm->IsFixedPitch ? 0 : TMPF_FIXED_PITCH;
pTM->tmPitchAndFamily |= TMPF_DEVICE;
ptm->tmPitchAndFamily = pafm->IsFixedPitch ? 0 : TMPF_FIXED_PITCH;
ptm->tmPitchAndFamily |= TMPF_DEVICE;
plf->lfPitchAndFamily = 0;
lstrcpynA( plf->lfFaceName, pafm->FamilyName, LF_FACESIZE );
MultiByteToWideChar(CP_ACP, 0, pafm->FamilyName, -1,
plf->lfFaceName, LF_FACESIZE);
#undef plf
pTM->tmAscent = pafm->FullAscender * scale;
pTM->tmDescent = -pafm->Descender * scale;
pTM->tmInternalLeading = (pafm->FullAscender - pafm->Ascender) * scale;
pTM->tmMaxCharWidth = pafm->CharWidths[77] * scale;
pTM->tmDigitizedAspectX = dc->devCaps->logPixelsY;
pTM->tmDigitizedAspectY = dc->devCaps->logPixelsX;
ptm->tmAscent = pafm->FullAscender * scale;
ptm->tmDescent = -pafm->Descender * scale;
ptm->tmInternalLeading = (pafm->FullAscender - pafm->Ascender) * scale;
ptm->tmMaxCharWidth = pafm->CharWidths[77] * scale;
ptm->tmDigitizedAspectX = dc->devCaps->logPixelsY;
ptm->tmDigitizedAspectY = dc->devCaps->logPixelsX;
*(INT*)&pTM->tmFirstChar = 32;
*(INT*)&ptm->tmFirstChar = 32;
GDI_ReleaseObj( hdc );
/* return font type */
return DEVICE_FONTTYPE;
return DEVICE_FONTTYPE;
#undef ptm
}
/***********************************************************************
* PSDRV_EnumDeviceFonts
*/
BOOL PSDRV_EnumDeviceFonts( HDC hdc, LPLOGFONT16 plf,
DEVICEFONTENUMPROC proc, LPARAM lp )
BOOL PSDRV_EnumDeviceFonts( HDC hdc, LPLOGFONTW plf,
DEVICEFONTENUMPROC proc, LPARAM lp )
{
ENUMLOGFONTEX16 lf;
NEWTEXTMETRIC16 tm;
ENUMLOGFONTEXW lf;
NEWTEXTMETRICEXW tm;
BOOL b, bRet = 0;
AFMLISTENTRY *afmle;
FONTFAMILY *family;
PSDRV_PDEVICE *physDev;
char FaceName[LF_FACESIZE];
DC *dc = DC_GetDCPtr( hdc );
if (!dc) return FALSE;
@ -336,9 +341,11 @@ BOOL PSDRV_EnumDeviceFonts( HDC hdc, LPLOGFONT16 plf,
GDI_ReleaseObj( hdc );
if( plf->lfFaceName[0] ) {
TRACE("lfFaceName = '%s'\n", plf->lfFaceName);
WideCharToMultiByte(CP_ACP, 0, plf->lfFaceName, -1,
FaceName, sizeof(FaceName), NULL, NULL);
TRACE("lfFaceName = '%s'\n", FaceName);
for(family = physDev->pi->Fonts; family; family = family->next) {
if(!strncmp(plf->lfFaceName, family->FamilyName,
if(!strncmp(FaceName, family->FamilyName,
strlen(family->FamilyName)))
break;
}

View File

@ -36,7 +36,7 @@ typedef struct _tagAFM {
char *FullName;
char *FamilyName;
char *EncodingScheme;
int Weight; /* FW_NORMAL etc. */
LONG Weight; /* FW_NORMAL etc. */
float ItalicAngle;
BOOL IsFixedPitch;
float UnderlinePosition;
@ -271,7 +271,6 @@ extern void PSDRV_CreateColor( PSDRV_PDEVICE *physDev, PSCOLOR *pscolor,
COLORREF wincolor );
extern char PSDRV_UnicodeToANSI(int u);
extern INT PSDRV_WriteHeader( DC *dc, LPCSTR title );
extern INT PSDRV_WriteFooter( DC *dc );
extern INT PSDRV_WriteNewPage( DC *dc );
@ -329,8 +328,8 @@ extern BOOL PSDRV_Ellipse( DC *dc, INT left, INT top, INT right,
INT bottom );
extern INT PSDRV_EndDoc( DC *dc );
extern INT PSDRV_EndPage( DC *dc );
extern BOOL PSDRV_EnumDeviceFonts( HDC hdc, LPLOGFONT16 plf,
DEVICEFONTENUMPROC proc, LPARAM lp );
extern BOOL PSDRV_EnumDeviceFonts( HDC hdc, LPLOGFONTW plf,
DEVICEFONTENUMPROC proc, LPARAM lp );
extern INT PSDRV_Escape( DC *dc, INT nEscape, INT cbInput,
SEGPTR lpInData, SEGPTR lpOutData );
extern BOOL PSDRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,

View File

@ -147,7 +147,7 @@ static BOOL EMFDRV_CreateFontIndirect(DC *dc, HFONT hFont )
emr.emr.iType = EMR_EXTCREATEFONTINDIRECTW;
emr.emr.nSize = (sizeof(emr) + 3) / 4 * 4;
emr.ihFont = index = EMFDRV_AddHandleDC( dc );
FONT_LogFont16To32W( &(fontObj->logfont), &(emr.elfw.elfLogFont) );
memcpy( &(emr.elfw.elfLogFont), &(fontObj->logfont), sizeof(LOGFONTW) );
emr.elfw.elfFullName[0] = '\0';
emr.elfw.elfStyle[0] = '\0';
emr.elfw.elfVersion = 0;

View File

@ -185,7 +185,9 @@ static HFONT16 MFDRV_FONT_SelectObject( DC * dc, HFONT16 hfont,
FONTOBJ * font )
{
HFONT16 prevHandle = dc->hFont;
if (MFDRV_CreateFontIndirect(dc, hfont, &(font->logfont)))
LOGFONT16 lf16;
FONT_LogFontWTo16(&(font->logfont), &lf16);
if (MFDRV_CreateFontIndirect(dc, hfont, &lf16))
return prevHandle;
return 0;
}

View File

@ -56,7 +56,7 @@ BOOL WIN16DRV_GetTextMetrics( DC *dc, TEXTMETRICA *metrics )
TRACE("%04x \n", dc->hSelf);
FONT_TextMetric16to32A( &physDev->tm, metrics );
FONT_TextMetric16ToA( &physDev->tm, metrics );
TRACE(
"H %ld, A %ld, D %ld, Int %ld, Ext %ld, AW %ld, MW %ld, W %ld\n",
@ -80,8 +80,8 @@ HFONT WIN16DRV_FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font)
dc->hFont = hfont;
TRACE("WIN16DRV_FONT_SelectObject '%s' h=%d\n",
font->logfont.lfFaceName, font->logfont.lfHeight);
TRACE("WIN16DRV_FONT_SelectObject '%s' h=%ld\n",
debugstr_w(font->logfont.lfFaceName), font->logfont.lfHeight);
if( physDev->FontInfo )
@ -92,7 +92,7 @@ HFONT WIN16DRV_FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font)
physDev->FontInfo, 0);
}
memcpy(&physDev->lf, &font->logfont, sizeof(LOGFONT16));
FONT_LogFontWTo16(&font->logfont, &physDev->lf);
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_FONT,
&physDev->lf, 0, 0);
@ -150,7 +150,7 @@ HFONT WIN16DRV_FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font)
}
/***********************************************************************
* GetCharWidth32A (GDI32.155)
* GetCharWidth32A (GDI32.@)
*/
BOOL WIN16DRV_GetCharWidth( DC *dc, UINT firstChar, UINT lastChar,
LPINT buffer )
@ -181,14 +181,15 @@ BOOL WIN16DRV_GetCharWidth( DC *dc, UINT firstChar, UINT lastChar,
* WIN16DRV_EnumDeviceFonts
*/
BOOL WIN16DRV_EnumDeviceFonts( HDC hdc, LPLOGFONT16 plf,
DEVICEFONTENUMPROC proc, LPARAM lp )
BOOL WIN16DRV_EnumDeviceFonts( HDC hdc, LPLOGFONTW plf,
DEVICEFONTENUMPROC proc, LPARAM lp )
{
WIN16DRV_PDEVICE *physDev;
WORD wRet;
WEPFC wepfc;
DC *dc;
/* EnumDFontCallback is GDI.158 */
char *FaceNameA = NULL;
/* EnumDFontCallback is GDI.158 */
FARPROC16 pfnCallback = GetProcAddress16( GetModuleHandle16("GDI"), (LPCSTR)158 );
if (!(dc = DC_GetDCPtr( hdc ))) return 0;
@ -196,11 +197,20 @@ BOOL WIN16DRV_EnumDeviceFonts( HDC hdc, LPLOGFONT16 plf,
/* FIXME!! */
GDI_ReleaseObj( hdc );
wepfc.proc = (int (*)(LPENUMLOGFONT16,LPNEWTEXTMETRIC16,UINT16,LPARAM))proc;
wepfc.proc = proc;
wepfc.lp = lp;
wRet = PRTDRV_EnumDFonts(physDev->segptrPDEVICE, plf->lfFaceName[0] ?
plf->lfFaceName : NULL , pfnCallback , &wepfc );
if(plf->lfFaceName[0]) {
INT len;
len = WideCharToMultiByte(CP_ACP, 0, plf->lfFaceName, -1, NULL, 0,
NULL, NULL);
FaceNameA = HeapAlloc(GetProcessHeap(), 0, len);
WideCharToMultiByte(CP_ACP, 0, plf->lfFaceName, -1, FaceNameA, len,
NULL, NULL);
}
wRet = PRTDRV_EnumDFonts(physDev->segptrPDEVICE, FaceNameA, pfnCallback,
&wepfc );
if(FaceNameA) HeapFree(GetProcessHeap(), 0, FaceNameA);
return wRet;
}
@ -218,8 +228,27 @@ WORD WINAPI EnumCallback16(LPENUMLOGFONT16 lpLogFont,
LPNEWTEXTMETRIC16 lpTextMetrics,
WORD wFontType, LONG lpClientData)
{
ENUMLOGFONTEXW lfW;
ENUMLOGFONTEX16 lf16;
NEWTEXTMETRICEXW tmW;
NEWTEXTMETRICEX16 tm16;
TRACE("In EnumCallback16 plf=%p\n", lpLogFont);
return (*(((WEPFC *)lpClientData)->proc))( lpLogFont, lpTextMetrics,
wFontType, ((WEPFC *)lpClientData)->lp );
/* we have a ENUMLOGFONT16 which is a subset of ENUMLOGFONTEX16,
so we copy it into one of these and then convert to ENUMLOGFONTEXW */
memset(&lf16, 0, sizeof(lf16));
memcpy(&lf16, lpLogFont, sizeof(*lpLogFont));
FONT_EnumLogFontEx16ToW(&lf16, &lfW);
/* and a similar idea for NEWTEXTMETRIC16 */
memset(&tm16, 0, sizeof(tm16));
memcpy(&tm16, lpTextMetrics, sizeof(*lpTextMetrics));
FONT_NewTextMetricEx16ToW(&tm16, &tmW);
return (*(((WEPFC *)lpClientData)->proc))( &lfW, &tmW, wFontType,
((WEPFC *)lpClientData)->lp );
}

View File

@ -1156,50 +1156,61 @@ static void XFONT_SetFontMetric(fontInfo* fi, const fontResource* fr, XFontStruc
*
* Retrieve font metric info (enumeration).
*/
static UINT XFONT_GetFontMetric( const fontInfo* pfi, const LPENUMLOGFONTEX16 pLF,
const LPNEWTEXTMETRIC16 pTM )
static UINT XFONT_GetFontMetric( const fontInfo* pfi,
const LPENUMLOGFONTEXW pLF,
const LPNEWTEXTMETRICEXW pTM )
{
memset( pLF, 0, sizeof(*pLF) );
memset( pTM, 0, sizeof(*pTM) );
#define plf ((LPLOGFONT16)pLF)
plf->lfHeight = pTM->tmHeight = pfi->df.dfPixHeight;
plf->lfWidth = pTM->tmAveCharWidth = pfi->df.dfAvgWidth;
plf->lfWeight = pTM->tmWeight = pfi->df.dfWeight;
plf->lfItalic = pTM->tmItalic = pfi->df.dfItalic;
plf->lfUnderline = pTM->tmUnderlined = pfi->df.dfUnderline;
plf->lfStrikeOut = pTM->tmStruckOut = pfi->df.dfStrikeOut;
plf->lfCharSet = pTM->tmCharSet = pfi->df.dfCharSet;
#define plf ((LPLOGFONTW)pLF)
#define ptm ((LPNEWTEXTMETRICW)pTM)
plf->lfHeight = ptm->tmHeight = pfi->df.dfPixHeight;
plf->lfWidth = ptm->tmAveCharWidth = pfi->df.dfAvgWidth;
plf->lfWeight = ptm->tmWeight = pfi->df.dfWeight;
plf->lfItalic = ptm->tmItalic = pfi->df.dfItalic;
plf->lfUnderline = ptm->tmUnderlined = pfi->df.dfUnderline;
plf->lfStrikeOut = ptm->tmStruckOut = pfi->df.dfStrikeOut;
plf->lfCharSet = ptm->tmCharSet = pfi->df.dfCharSet;
/* convert pitch values */
pTM->tmPitchAndFamily = pfi->df.dfPitchAndFamily;
ptm->tmPitchAndFamily = pfi->df.dfPitchAndFamily;
plf->lfPitchAndFamily = (pfi->df.dfPitchAndFamily & 0xF1) + 1;
lstrcpynA( plf->lfFaceName, pfi->df.dfFace, LF_FACESIZE );
MultiByteToWideChar(CP_ACP, 0, pfi->df.dfFace, -1,
plf->lfFaceName, LF_FACESIZE);
/* FIXME: fill in rest of plF values */
strcpyW(pLF->elfFullName, plf->lfFaceName);
MultiByteToWideChar(CP_ACP, 0, "Regular", -1,
pLF->elfStyle, LF_FACESIZE);
MultiByteToWideChar(CP_ACP, 0, plf->lfCharSet == SYMBOL_CHARSET ?
"Symbol" : "Roman", -1,
pLF->elfScript, LF_FACESIZE);
#undef plf
/* FIXME: fill in rest of plF values
lstrcpynA(plF->elfFullName, , LF_FULLFACESIZE);
lstrcpynA(plF->elfStyle, , LF_FACESIZE);
lstrcpynA(plF->elfScript, , LF_FACESIZE);
*/
ptm->tmAscent = pfi->df.dfAscent;
ptm->tmDescent = ptm->tmHeight - ptm->tmAscent;
ptm->tmInternalLeading = pfi->df.dfInternalLeading;
ptm->tmMaxCharWidth = pfi->df.dfMaxWidth;
ptm->tmDigitizedAspectX = pfi->df.dfHorizRes;
ptm->tmDigitizedAspectY = pfi->df.dfVertRes;
pTM->tmAscent = pfi->df.dfAscent;
pTM->tmDescent = pTM->tmHeight - pTM->tmAscent;
pTM->tmInternalLeading = pfi->df.dfInternalLeading;
pTM->tmMaxCharWidth = pfi->df.dfMaxWidth;
pTM->tmDigitizedAspectX = pfi->df.dfHorizRes;
pTM->tmDigitizedAspectY = pfi->df.dfVertRes;
pTM->tmFirstChar = pfi->df.dfFirstChar;
pTM->tmLastChar = pfi->df.dfLastChar;
pTM->tmDefaultChar = pfi->df.dfDefaultChar;
pTM->tmBreakChar = pfi->df.dfBreakChar;
ptm->tmFirstChar = pfi->df.dfFirstChar;
ptm->tmLastChar = pfi->df.dfLastChar;
ptm->tmDefaultChar = pfi->df.dfDefaultChar;
ptm->tmBreakChar = pfi->df.dfBreakChar;
TRACE("Calling Enum proc with FaceName '%s' FullName '%s'\n",
debugstr_w(pLF->elfLogFont.lfFaceName),
debugstr_w(pLF->elfFullName));
TRACE("CharSet = %d type = %d\n", ptm->tmCharSet, pfi->df.dfType);
/* return font type */
return pfi->df.dfType;
#undef ptm
}
@ -3049,7 +3060,7 @@ HFONT X11DRV_FONT_SelectObject( DC* dc, HFONT hfont, FONTOBJ* font )
if( CHECK_PFONT(physDev->font) )
XFONT_ReleaseCacheEntry( __PFONT(physDev->font) );
lf = font->logfont;
FONT_LogFontWTo16(&font->logfont, &lf);
/* Make sure we don't change the sign when converting to device coords */
/* FIXME - check that the other drivers do this correctly */
@ -3085,9 +3096,11 @@ HFONT X11DRV_FONT_SelectObject( DC* dc, HFONT hfont, FONTOBJ* font )
* so that GetTextFace can get the correct face name
*/
if (alias && !strcmp(faceMatched, lf.lfFaceName))
strcpy( font->logfont.lfFaceName, alias );
MultiByteToWideChar(CP_ACP, 0, alias, -1,
font->logfont.lfFaceName, LF_FACESIZE);
else
strcpy( font->logfont.lfFaceName, faceMatched );
MultiByteToWideChar(CP_ACP, 0, faceMatched, -1,
font->logfont.lfFaceName, LF_FACESIZE);
/*
* In X, some encodings may have the same lfFaceName.
@ -3112,18 +3125,22 @@ HFONT X11DRV_FONT_SelectObject( DC* dc, HFONT hfont, FONTOBJ* font )
*
* X11DRV_EnumDeviceFonts
*/
BOOL X11DRV_EnumDeviceFonts( HDC hdc, LPLOGFONT16 plf,
DEVICEFONTENUMPROC proc, LPARAM lp )
BOOL X11DRV_EnumDeviceFonts( HDC hdc, LPLOGFONTW plf,
DEVICEFONTENUMPROC proc, LPARAM lp )
{
ENUMLOGFONTEX16 lf;
NEWTEXTMETRIC16 tm;
ENUMLOGFONTEXW lf;
NEWTEXTMETRICEXW tm;
fontResource* pfr = fontList;
BOOL b, bRet = 0;
LOGFONT16 lf16;
if( plf->lfFaceName[0] )
FONT_LogFontWTo16(plf, &lf16);
if( lf16.lfFaceName[0] )
{
/* enum all entries in this resource */
pfr = XFONT_FindFIList( pfr, plf->lfFaceName );
pfr = XFONT_FindFIList( pfr, lf16.lfFaceName );
if( pfr )
{
fontInfo* pfi;
@ -3133,10 +3150,13 @@ BOOL X11DRV_EnumDeviceFonts( HDC hdc, LPLOGFONT16 plf,
release the crit section, font list will
have to be retraversed on return */
if( (b = (*proc)( &lf, &tm,
XFONT_GetFontMetric( pfi, &lf, &tm ), lp )) )
bRet = b;
else break;
if(lf16.lfCharSet == DEFAULT_CHARSET ||
lf16.lfCharSet == pfi->df.dfCharSet) {
if( (b = (*proc)( &lf, &tm,
XFONT_GetFontMetric( pfi, &lf, &tm ), lp )) )
bRet = b;
else break;
}
}
}
}
@ -3145,9 +3165,9 @@ BOOL X11DRV_EnumDeviceFonts( HDC hdc, LPLOGFONT16 plf,
{
if(pfr->fi)
{
if( (b = (*proc)( &lf, &tm,
XFONT_GetFontMetric( pfr->fi, &lf, &tm ), lp )) )
bRet = b;
if( (b = (*proc)( &lf, &tm,
XFONT_GetFontMetric( pfr->fi, &lf, &tm ), lp )) )
bRet = b;
else break;
}
}

View File

@ -15,7 +15,7 @@
typedef struct
{
GDIOBJHDR header;
LOGFONT16 logfont WINE_PACKED;
LOGFONTW logfont;
} FONTOBJ;
typedef struct {
@ -59,16 +59,18 @@ extern BOOL FONT_Init( UINT16* pTextCaps );
extern INT16 FONT_GetObject16( FONTOBJ * font, INT16 count, LPSTR buffer );
extern INT FONT_GetObjectA( FONTOBJ * font, INT count, LPSTR buffer );
extern INT FONT_GetObjectW( FONTOBJ * font, INT count, LPSTR buffer );
extern void FONT_LogFont32ATo16( const LOGFONTA* font32, LPLOGFONT16 font16 );
extern void FONT_LogFont32WTo16( const LOGFONTW* font32, LPLOGFONT16 font16 );
extern void FONT_LogFont16To32A( const LPLOGFONT16 font16, LPLOGFONTA font32 );
extern void FONT_LogFont16To32W( const LPLOGFONT16 font16, LPLOGFONTW font32 );
extern void FONT_TextMetric32Ato16(const LPTEXTMETRICA ptm32, LPTEXTMETRIC16 ptm16 );
extern void FONT_TextMetric32Wto16(const LPTEXTMETRICW ptm32, LPTEXTMETRIC16 ptm16 );
extern void FONT_TextMetric16to32A(const LPTEXTMETRIC16 ptm16, LPTEXTMETRICA ptm32 );
extern void FONT_TextMetric16to32W(const LPTEXTMETRIC16 ptm16, LPTEXTMETRICW ptm32 );
extern void FONT_TextMetric32Ato32W(const LPTEXTMETRICA ptm32A, LPTEXTMETRICW ptm32W );
extern void FONT_LogFontATo16( const LOGFONTA* font32, LPLOGFONT16 font16 );
extern void FONT_LogFontWTo16( const LOGFONTW* font32, LPLOGFONT16 font16 );
extern void FONT_LogFont16ToA( const LOGFONT16* font16, LPLOGFONTA font32 );
extern void FONT_LogFont16ToW( const LOGFONT16* font16, LPLOGFONTW font32 );
extern void FONT_TextMetricATo16(const TEXTMETRICA *ptm32, LPTEXTMETRIC16 ptm16 );
extern void FONT_TextMetricWTo16(const TEXTMETRICW *ptm32, LPTEXTMETRIC16 ptm16 );
extern void FONT_TextMetric16ToA(const TEXTMETRIC16 *ptm16, LPTEXTMETRICA ptm32 );
extern void FONT_TextMetric16ToW(const TEXTMETRIC16 *ptm16, LPTEXTMETRICW ptm32 );
extern void FONT_TextMetricAToW(const TEXTMETRICA *ptm32A, LPTEXTMETRICW ptm32W );
extern void FONT_NewTextMetricEx16ToW(const NEWTEXTMETRICEX16*, LPNEWTEXTMETRICEXW);
extern void FONT_EnumLogFontEx16ToW(const ENUMLOGFONTEX16*, LPENUMLOGFONTEXW);
extern BOOL ENGINE_InitFonts(void);
#endif /* __WINE_FONT_H */

View File

@ -155,7 +155,8 @@ typedef struct tagDC
/* Device functions for the Wine driver interface */
typedef INT (*DEVICEFONTENUMPROC)(LPENUMLOGFONTEX16,LPNEWTEXTMETRIC16,UINT16,LPARAM);
typedef INT (*DEVICEFONTENUMPROC)(LPENUMLOGFONTEXW,LPNEWTEXTMETRICEXW,DWORD,
LPARAM);
typedef struct tagDC_FUNCS
{
@ -184,7 +185,7 @@ typedef struct tagDC_FUNCS
INT (*pEndDoc)(DC*);
INT (*pEndPage)(DC*);
BOOL (*pEndPath)(DC*);
BOOL (*pEnumDeviceFonts)(HDC,LPLOGFONT16,DEVICEFONTENUMPROC,LPARAM);
BOOL (*pEnumDeviceFonts)(HDC,LPLOGFONTW,DEVICEFONTENUMPROC,LPARAM);
INT (*pEscape)(DC*,INT,INT,SEGPTR,SEGPTR);
INT (*pExcludeClipRect)(DC*,INT,INT,INT,INT);
INT (*pExtDeviceMode)(LPSTR,HWND,LPDEVMODEA,LPSTR,LPSTR,LPDEVMODEA,

View File

@ -137,7 +137,7 @@ typedef struct DRAWMODE
typedef struct WINE_ENUM_PRINTER_FONT_CALLBACK
{
int (*proc)(LPENUMLOGFONT16, LPNEWTEXTMETRIC16, UINT16, LPARAM);
DEVICEFONTENUMPROC proc;
LPARAM lp;
} WEPFC;
@ -224,8 +224,8 @@ extern HGDIOBJ WIN16DRV_SelectObject( DC *dc, HGDIOBJ handle );
extern BOOL WIN16DRV_PatBlt( struct tagDC *dc, INT left, INT top,
INT width, INT height, DWORD rop );
extern BOOL WIN16DRV_Ellipse(DC *dc, INT left, INT top, INT right, INT bottom);
extern BOOL WIN16DRV_EnumDeviceFonts( HDC hdc, LPLOGFONT16 plf,
DEVICEFONTENUMPROC proc, LPARAM lp );
extern BOOL WIN16DRV_EnumDeviceFonts( HDC hdc, LPLOGFONTW plf,
DEVICEFONTENUMPROC proc, LPARAM lp );
extern INT WIN16DRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd,
LPDEVMODEA lpdmOutput,

View File

@ -92,8 +92,8 @@ extern const DC_FUNCTIONS X11DRV_DC_Funcs;
extern BOOL X11DRV_BitBlt( struct tagDC *dcDst, INT xDst, INT yDst,
INT width, INT height, struct tagDC *dcSrc,
INT xSrc, INT ySrc, DWORD rop );
extern BOOL X11DRV_EnumDeviceFonts( HDC hdc, LPLOGFONT16 plf,
DEVICEFONTENUMPROC dfeproc, LPARAM lp );
extern BOOL X11DRV_EnumDeviceFonts( HDC hdc, LPLOGFONTW plf,
DEVICEFONTENUMPROC dfeproc, LPARAM lp );
extern BOOL X11DRV_GetCharWidth( struct tagDC *dc, UINT firstChar,
UINT lastChar, LPINT buffer );
extern BOOL X11DRV_GetDCOrgEx( struct tagDC *dc, LPPOINT lpp );

File diff suppressed because it is too large Load Diff

View File

@ -96,61 +96,54 @@ static FONTOBJ OEMFixedFont =
{
{ 0, FONT_MAGIC, 1 }, /* header */
{ 0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, OEM_CHARSET,
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, "" }
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, {'\0'} }
};
/* Filler to make the location counter dword aligned again. This is necessary
since (a) FONTOBJ is packed, (b) gcc places initialised variables in the code
segment, and (c) Solaris assembler is stupid. */
static UINT16 align_OEMFixedFont = 1;
static FONTOBJ AnsiFixedFont =
{
{ 0, FONT_MAGIC, 1 }, /* header */
{ 0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, "" }
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, {'\0'} }
};
static UINT16 align_AnsiFixedFont = 1;
static FONTOBJ AnsiVarFont =
{
{ 0, FONT_MAGIC, 1 }, /* header */
{ 0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS, "MS Sans Serif" }
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
{'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'} }
};
static UINT16 align_AnsiVarFont = 1;
static FONTOBJ SystemFont =
{
{ 0, FONT_MAGIC, 1 },
{ 0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS, "System" }
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
{'S','y','s','t','e','m','\0'} }
};
static UINT16 align_SystemFont = 1;
static FONTOBJ DeviceDefaultFont =
{
{ 0, FONT_MAGIC, 1 }, /* header */
{ 0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS, "" }
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS, {'\0'} }
};
static UINT16 align_DeviceDefaultFont = 1;
static FONTOBJ SystemFixedFont =
{
{ 0, FONT_MAGIC, 1 }, /* header */
{ 0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, "" }
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, {'\0'} }
};
static UINT16 align_SystemFixedFont = 1;
/* FIXME: Is this correct? */
static FONTOBJ DefaultGuiFont =
{
{ 0, FONT_MAGIC, 1 }, /* header */
{ 0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS, "MS Sans Serif" }
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS,
{'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'} }
};
static UINT16 align_DefaultGuiFont = 1;
static GDIOBJHDR * StockObjects[NB_STOCK_OBJECTS] =
@ -329,15 +322,6 @@ BOOL GDI_Init(void)
if ((instance = LoadLibrary16( "GDI.EXE" )) < 32) return FALSE;
GDI_HeapSel = GlobalHandleToSel16( instance );
/* Kill some warnings. */
(void)align_OEMFixedFont;
(void)align_AnsiFixedFont;
(void)align_AnsiVarFont;
(void)align_SystemFont;
(void)align_DeviceDefaultFont;
(void)align_SystemFixedFont;
(void)align_DefaultGuiFont;
/* TWEAK: Initialize font hints */
ReadFontInformation("OEMFixed", &OEMFixedFont, 0, 0, 0, 0, 0);
ReadFontInformation("AnsiFixed", &AnsiFixedFont, 0, 0, 0, 0, 0);
@ -551,7 +535,7 @@ void GDI_ReleaseObj( HGDIOBJ handle )
/***********************************************************************
* DeleteObject16 (GDI.69)
* DeleteObject16 (GDI.605)
*/
BOOL16 WINAPI DeleteObject16( HGDIOBJ16 obj )
{
@ -560,7 +544,7 @@ BOOL16 WINAPI DeleteObject16( HGDIOBJ16 obj )
/***********************************************************************
* DeleteObject (GDI32.70)
* DeleteObject (GDI32.@)
*/
BOOL WINAPI DeleteObject( HGDIOBJ obj )
{
@ -619,7 +603,7 @@ HGDIOBJ16 WINAPI GetStockObject16( INT16 obj )
/***********************************************************************
* GetStockObject (GDI32.220)
* GetStockObject (GDI32.@)
*/
HGDIOBJ WINAPI GetStockObject( INT obj )
{
@ -675,7 +659,7 @@ INT16 WINAPI GetObject16( HANDLE16 handle, INT16 count, LPVOID buffer )
/***********************************************************************
* GetObjectA (GDI32.204)
* GetObjectA (GDI32.@)
*/
INT WINAPI GetObjectA( HANDLE handle, INT count, LPVOID buffer )
{
@ -731,7 +715,7 @@ INT WINAPI GetObjectA( HANDLE handle, INT count, LPVOID buffer )
}
/***********************************************************************
* GetObjectW (GDI32.206)
* GetObjectW (GDI32.@)
*/
INT WINAPI GetObjectW( HANDLE handle, INT count, LPVOID buffer )
{
@ -775,7 +759,7 @@ INT WINAPI GetObjectW( HANDLE handle, INT count, LPVOID buffer )
}
/***********************************************************************
* GetObjectType (GDI32.205)
* GetObjectType (GDI32.@)
*/
DWORD WINAPI GetObjectType( HANDLE handle )
{
@ -832,7 +816,7 @@ DWORD WINAPI GetObjectType( HANDLE handle )
}
/***********************************************************************
* GetCurrentObject (GDI32.166)
* GetCurrentObject (GDI32.@)
*/
HANDLE WINAPI GetCurrentObject(HDC hdc,UINT type)
{
@ -868,7 +852,7 @@ HGDIOBJ16 WINAPI SelectObject16( HDC16 hdc, HGDIOBJ16 handle )
/***********************************************************************
* SelectObject (GDI32.299)
* SelectObject (GDI32.@)
*/
HGDIOBJ WINAPI SelectObject( HDC hdc, HGDIOBJ handle )
{
@ -893,7 +877,7 @@ BOOL16 WINAPI UnrealizeObject16( HGDIOBJ16 obj )
/***********************************************************************
* UnrealizeObject (GDI32.358)
* UnrealizeObject (GDI32.@)
*/
BOOL WINAPI UnrealizeObject( HGDIOBJ obj )
{
@ -1002,7 +986,7 @@ INT16 WINAPI EnumObjects16( HDC16 hdc, INT16 nObjType,
/***********************************************************************
* EnumObjects (GDI32.89)
* EnumObjects (GDI32.@)
*/
INT WINAPI EnumObjects( HDC hdc, INT nObjType,
GOBJENUMPROC lpEnumFunc, LPARAM lParam )
@ -1106,7 +1090,7 @@ void WINAPI SetObjectOwner16( HGDIOBJ16 handle, HANDLE16 owner )
/***********************************************************************
* SetObjectOwner (GDI32.386)
* SetObjectOwner (GDI32.@)
*/
void WINAPI SetObjectOwner( HGDIOBJ handle, HANDLE owner )
{
@ -1138,7 +1122,7 @@ void WINAPI MakeObjectPrivate16( HGDIOBJ16 handle, BOOL16 private )
/***********************************************************************
* GdiFlush (GDI32.128)
* GdiFlush (GDI32.@)
*/
BOOL WINAPI GdiFlush(void)
{
@ -1147,7 +1131,7 @@ BOOL WINAPI GdiFlush(void)
/***********************************************************************
* GdiGetBatchLimit (GDI32.129)
* GdiGetBatchLimit (GDI32.@)
*/
DWORD WINAPI GdiGetBatchLimit(void)
{
@ -1156,7 +1140,7 @@ DWORD WINAPI GdiGetBatchLimit(void)
/***********************************************************************
* GdiSetBatchLimit (GDI32.139)
* GdiSetBatchLimit (GDI32.@)
*/
DWORD WINAPI GdiSetBatchLimit( DWORD limit )
{
@ -1240,7 +1224,7 @@ INT16 WINAPI MulDiv16(
/*******************************************************************
* GetColorAdjustment [GDI32.164]
* GetColorAdjustment [GDI32.@]
*
*
*/
@ -1251,7 +1235,7 @@ BOOL WINAPI GetColorAdjustment(HDC hdc, LPCOLORADJUSTMENT lpca)
}
/*******************************************************************
* GetMiterLimit [GDI32.201]
* GetMiterLimit [GDI32.@]
*
*
*/
@ -1262,7 +1246,7 @@ BOOL WINAPI GetMiterLimit(HDC hdc, PFLOAT peLimit)
}
/*******************************************************************
* SetMiterLimit [GDI32.325]
* SetMiterLimit [GDI32.@]
*
*
*/
@ -1273,7 +1257,7 @@ BOOL WINAPI SetMiterLimit(HDC hdc, FLOAT eNewLimit, PFLOAT peOldLimit)
}
/*******************************************************************
* GdiComment [GDI32.109]
* GdiComment [GDI32.@]
*
*
*/
@ -1283,7 +1267,7 @@ BOOL WINAPI GdiComment(HDC hdc, UINT cbSize, const BYTE *lpData)
return 0;
}
/*******************************************************************
* SetColorAdjustment [GDI32.309]
* SetColorAdjustment [GDI32.@]
*
*
*/