[GDI32_APITEST] Improve CreateFontIndirect testcase

This commit is contained in:
Katayama Hirofumi MZ 2019-01-06 09:12:00 +09:00
parent 5053f1f571
commit cdaff94c3d

View file

@ -179,7 +179,11 @@ is_truetype_font_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm,
static BOOL is_truetype_font_installed(HDC hDC, const char *name)
{
if (!EnumFontFamiliesA(hDC, name, is_truetype_font_proc, 0))
LOGFONT lf;
ZeroMemory(&lf, sizeof(lf));
lf.lfCharSet = DEFAULT_CHARSET;
lstrcpy(lf.lfFaceName, name);
if (!EnumFontFamiliesExA(hDC, &lf, is_truetype_font_proc, 0, 0))
return TRUE;
return FALSE;
}
@ -195,7 +199,10 @@ is_charset_font_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm,
static BOOL is_charset_font_installed(HDC hDC, BYTE CharSet)
{
if (!EnumFontFamiliesA(hDC, NULL, is_charset_font_proc, CharSet))
LOGFONT lf;
ZeroMemory(&lf, sizeof(lf));
lf.lfCharSet = DEFAULT_CHARSET;
if (!EnumFontFamiliesExA(hDC, &lf, is_charset_font_proc, CharSet, 0))
return TRUE;
return FALSE;
}
@ -215,7 +222,10 @@ is_fixed_charset_font_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm,
static BOOL
is_fixed_charset_font_installed(HDC hDC, BYTE CharSet)
{
if (!EnumFontFamiliesA(hDC, NULL, is_fixed_charset_font_proc, CharSet))
LOGFONT lf;
ZeroMemory(&lf, sizeof(lf));
lf.lfCharSet = DEFAULT_CHARSET;
if (!EnumFontFamiliesExA(hDC, &lf, is_fixed_charset_font_proc, CharSet, 0))
return TRUE;
return FALSE;
}