mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 01:49:16 +00:00
Get Wine to behave like Windows does when Bold and/or Italic is
specified in the typeface name argument to CreateFont.
This commit is contained in:
parent
8f174bc654
commit
3156df8539
|
@ -317,6 +317,11 @@ HFONT WINAPI CreateFontIndirectW( const LOGFONTW *plf )
|
||||||
if ((fontPtr = GDI_AllocObject( sizeof(FONTOBJ), FONT_MAGIC,
|
if ((fontPtr = GDI_AllocObject( sizeof(FONTOBJ), FONT_MAGIC,
|
||||||
(HGDIOBJ *)&hFont, &font_funcs )))
|
(HGDIOBJ *)&hFont, &font_funcs )))
|
||||||
{
|
{
|
||||||
|
static const WCHAR ItalicW[] = {' ','I','t','a','l','i','c','\0'};
|
||||||
|
static const WCHAR BoldW[] = {' ','B','o','l','d','\0'};
|
||||||
|
WCHAR *pFaceNameItalicSuffix, *pFaceNameBoldSuffix;
|
||||||
|
WCHAR* pFaceNameSuffix = NULL;
|
||||||
|
|
||||||
memcpy( &fontPtr->logfont, plf, sizeof(LOGFONTW) );
|
memcpy( &fontPtr->logfont, plf, sizeof(LOGFONTW) );
|
||||||
|
|
||||||
TRACE("(%ld %ld %ld %ld %x %d %x %d %d) %s %s %s => %p\n",
|
TRACE("(%ld %ld %ld %ld %x %d %x %d %d) %s %s %s => %p\n",
|
||||||
|
@ -336,6 +341,26 @@ HFONT WINAPI CreateFontIndirectW( const LOGFONTW *plf )
|
||||||
"escapement angle %f for new font %p\n",
|
"escapement angle %f for new font %p\n",
|
||||||
plf->lfOrientation/10., plf->lfEscapement/10., hFont);
|
plf->lfOrientation/10., plf->lfEscapement/10., hFont);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pFaceNameItalicSuffix = strstrW(fontPtr->logfont.lfFaceName, ItalicW);
|
||||||
|
if (pFaceNameItalicSuffix) {
|
||||||
|
fontPtr->logfont.lfItalic = TRUE;
|
||||||
|
pFaceNameSuffix = pFaceNameItalicSuffix;
|
||||||
|
}
|
||||||
|
|
||||||
|
pFaceNameBoldSuffix = strstrW(fontPtr->logfont.lfFaceName, BoldW);
|
||||||
|
if (pFaceNameBoldSuffix) {
|
||||||
|
if (fontPtr->logfont.lfWeight < FW_BOLD) {
|
||||||
|
fontPtr->logfont.lfWeight = FW_BOLD;
|
||||||
|
}
|
||||||
|
if (!pFaceNameSuffix ||
|
||||||
|
(pFaceNameBoldSuffix < pFaceNameSuffix)) {
|
||||||
|
pFaceNameSuffix = pFaceNameBoldSuffix;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pFaceNameSuffix) *pFaceNameSuffix = 0;
|
||||||
|
|
||||||
GDI_ReleaseObj( hFont );
|
GDI_ReleaseObj( hFont );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue