mirror of
https://github.com/reactos/wine.git
synced 2025-04-01 07:31:34 +00:00
gdi32: Don't strip font suffix.
This commit is contained in:
parent
3f63a2968d
commit
e4beddb664
@ -306,10 +306,6 @@ HFONT WINAPI CreateFontIndirectA( const LOGFONTA *plfA )
|
||||
*/
|
||||
HFONT WINAPI CreateFontIndirectW( const LOGFONTW *plf )
|
||||
{
|
||||
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;
|
||||
HFONT hFont;
|
||||
FONTOBJ *fontPtr;
|
||||
|
||||
@ -328,24 +324,6 @@ HFONT WINAPI CreateFontIndirectW( const LOGFONTW *plf )
|
||||
plf->lfOrientation/10., plf->lfEscapement/10., fontPtr);
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
if (!(hFont = alloc_gdi_handle( &fontPtr->header, OBJ_FONT, &font_funcs )))
|
||||
{
|
||||
HeapFree( GetProcessHeap(), 0, fontPtr );
|
||||
|
@ -3013,15 +3013,12 @@ void test_CreateFontIndirect(void)
|
||||
ok(hfont != 0, "CreateFontIndirectA failed\n");
|
||||
ret = GetObject(hfont, sizeof(getobj_lf), &getobj_lf);
|
||||
ok(lf.lfItalic == getobj_lf.lfItalic, "lfItalic: expect %02x got %02x\n", lf.lfItalic, getobj_lf.lfItalic);
|
||||
todo_wine
|
||||
{
|
||||
ok(lf.lfWeight == getobj_lf.lfWeight ||
|
||||
broken((SHORT)lf.lfWeight == getobj_lf.lfWeight), /* win9x */
|
||||
"lfWeight: expect %08x got %08x\n", lf.lfWeight, getobj_lf.lfWeight);
|
||||
ok(!lstrcmpA(lf.lfFaceName, getobj_lf.lfFaceName) ||
|
||||
broken(!memcmp(lf.lfFaceName, getobj_lf.lfFaceName, LF_FACESIZE-1)), /* win9x doesn't ensure '\0' termination */
|
||||
"font names don't match: %s != %s\n", lf.lfFaceName, getobj_lf.lfFaceName);
|
||||
}
|
||||
DeleteObject(hfont);
|
||||
|
||||
lf.lfItalic = FALSE;
|
||||
@ -3033,13 +3030,10 @@ void test_CreateFontIndirect(void)
|
||||
ok(lf.lfWeight == getobj_lf.lfWeight ||
|
||||
broken((SHORT)lf.lfWeight == getobj_lf.lfWeight), /* win9x */
|
||||
"lfWeight: expect %08x got %08x\n", lf.lfWeight, getobj_lf.lfWeight);
|
||||
todo_wine
|
||||
{
|
||||
ok(lf.lfItalic == getobj_lf.lfItalic, "lfItalic: expect %02x got %02x\n", lf.lfItalic, getobj_lf.lfItalic);
|
||||
ok(!lstrcmpA(lf.lfFaceName, getobj_lf.lfFaceName) ||
|
||||
broken(!memcmp(lf.lfFaceName, getobj_lf.lfFaceName, LF_FACESIZE-1)), /* win9x doesn't ensure '\0' termination */
|
||||
"font names don't match: %s != %s\n", lf.lfFaceName, getobj_lf.lfFaceName);
|
||||
}
|
||||
DeleteObject(hfont);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user