https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cdaff94c3db31ba9c5910…
commit cdaff94c3db31ba9c59104a79136f03adb6bef04
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sun Jan 6 09:12:00 2019 +0900
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Sun Jan 6 09:20:30 2019 +0900
[GDI32_APITEST] Improve CreateFontIndirect testcase
---
modules/rostests/apitests/gdi32/CreateFontIndirect.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/modules/rostests/apitests/gdi32/CreateFontIndirect.c
b/modules/rostests/apitests/gdi32/CreateFontIndirect.c
index 4940957887..f284ac8eee 100644
--- a/modules/rostests/apitests/gdi32/CreateFontIndirect.c
+++ b/modules/rostests/apitests/gdi32/CreateFontIndirect.c
@@ -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;
}