253{
262 static const char *
text =
"This is a test.";
263
266 {
271
276 {
277 skip(
"Font file '%s' doesn't exists\n",
font->font_file);
278 continue;
279 }
280
281 trace(
"Testing '%s'.\n",
font->font_file);
282
283#ifdef EMIT_TESTCASES
284 printf(
"static const TEST_ENTRY g_%s[] =\n",
font->entry_name);
286 for (
k = 0;
k < g_test_entry_count; ++
k)
287 {
289
292
295 {
298 }
301
302 printf(
" { __LINE__, %ld, %ld, %ld, %ld, %ld, %ld, %ld, %ld, %ld },\n",
305 tm.tmHeight,
tm.tmAscent,
tm.tmDescent,
tm.tmInternalLeading,
tm.tmExternalLeading);
306 }
308 printf(
"#define g_%s_count _countof(g_%s)\n\n",
font->entry_name,
font->entry_name);
309#else
310 for (
k = 0;
k <
font->test_count; ++
k)
311 {
313
316
319 {
322 }
325
326 if (
test->cxText > 0)
327 {
328 ok_(__FILE__,
test->line)(
labs(
test->cxText - siz.
cx) <= 1,
"%s (%ld): cxText: labs(%ld - %ld) > 1\n",
font->entry_name,
test->lfHeight,
test->cxText, siz.
cx);
329 ok_(__FILE__,
test->line)(
labs(
test->cxText - siz.
cx) == 0,
"%s (%ld): cxText: labs(%ld - %ld) != 0\n",
font->entry_name,
test->lfHeight,
test->cxText, siz.
cx);
330 }
331 if (
test->cyText > 0)
332 {
333 ok_(__FILE__,
test->line)(
labs(
test->cyText - siz.
cy) <= 1,
"%s (%ld): cyText: labs(%ld - %ld) > 1\n",
font->entry_name,
test->lfHeight,
test->cyText, siz.
cy);
334 ok_(__FILE__,
test->line)(
labs(
test->cyText - siz.
cy) == 0,
"%s (%ld): cyText: labs(%ld - %ld) != 0\n",
font->entry_name,
test->lfHeight,
test->cyText, siz.
cy);
335 }
336 if (
test->tmHeight > 0)
337 {
338 ok_(__FILE__,
test->line)(
labs(
test->tmHeight -
tm.tmHeight) <= 1,
"%s (%ld): tmHeight: labs(%ld - %ld) > 1\n",
font->entry_name,
test->lfHeight,
test->tmHeight,
tm.tmHeight);
339 ok_(__FILE__,
test->line)(
labs(
test->tmHeight -
tm.tmHeight) == 0,
"%s (%ld): tmHeight: labs(%ld - %ld) != 0\n",
font->entry_name,
test->lfHeight,
test->tmHeight,
tm.tmHeight);
340 }
341 if (
test->tmAscent > 0)
342 {
343 ok_(__FILE__,
test->line)(
labs(
test->tmAscent -
tm.tmAscent) <= 1,
"%s (%ld): tmAscent: labs(%ld - %ld) > 1\n",
font->entry_name,
test->lfHeight,
test->tmAscent,
tm.tmAscent);
344 ok_(__FILE__,
test->line)(
labs(
test->tmAscent -
tm.tmAscent) == 0,
"%s (%ld): tmAscent: labs(%ld - %ld) != 0\n",
font->entry_name,
test->lfHeight,
test->tmAscent,
tm.tmAscent);
345 }
346 if (
test->tmDescent > 0)
347 {
348 ok_(__FILE__,
test->line)(
labs(
test->tmDescent -
tm.tmDescent) <= 1,
"%s (%ld): tmDescent: labs(%ld - %ld) > 1\n",
font->entry_name,
test->lfHeight,
test->tmDescent,
tm.tmDescent);
349 ok_(__FILE__,
test->line)(
labs(
test->tmDescent -
tm.tmDescent) == 0,
"%s (%ld): tmDescent: labs(%ld - %ld) != 0\n",
font->entry_name,
test->lfHeight,
test->tmDescent,
tm.tmDescent);
350 }
351 if (
test->tmInternalLeading > 0)
352 {
353 ok_(__FILE__,
test->line)(
labs(
test->tmInternalLeading -
tm.tmInternalLeading) <= 1,
"%s (%ld): tmInternalLeading: labs(%ld - %ld) > 1\n",
font->entry_name,
test->lfHeight,
test->tmInternalLeading,
tm.tmInternalLeading);
354 ok_(__FILE__,
test->line)(
labs(
test->tmInternalLeading -
tm.tmInternalLeading) == 0,
"%s (%ld): tmInternalLeading: labs(%ld - %ld) != 0\n",
font->entry_name,
test->lfHeight,
test->tmInternalLeading,
tm.tmInternalLeading);
355 }
356 if (
test->tmExternalLeading > 0)
357 {
358 ok_(__FILE__,
test->line)(
labs(
test->tmExternalLeading -
tm.tmExternalLeading) <= 1,
"%s (%ld): tmExternalLeading: labs(%ld - %ld) > 1\n",
font->entry_name,
test->lfHeight,
test->tmExternalLeading,
tm.tmExternalLeading);
359 ok_(__FILE__,
test->line)(
labs(
test->tmExternalLeading -
tm.tmExternalLeading) == 0,
"%s (%ld): tmExternalLeading: labs(%ld - %ld) != 0\n",
font->entry_name,
test->lfHeight,
test->tmExternalLeading,
tm.tmExternalLeading);
360 }
361 }
362#endif
363 }
365}
static FONT_ENTRY g_font_entries[]
static size_t g_font_entry_count
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_ long __cdecl labs(_In_ long x)
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
int WINAPI lstrlenA(LPCSTR lpString)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
CHAR lfFaceName[LF_FACESIZE]
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI DeleteDC(_In_ HDC)
BOOL WINAPI GetTextExtentPoint32A(_In_ HDC hdc, _In_reads_(c) LPCSTR lpString, _In_ int c, _Out_ LPSIZE psizl)