308 static const WCHAR testW[] = {
't',
'e',
's',
't',0};
309 static const char testA[] =
"test";
313 unsigned int expected_size;
314 unsigned int expected_levels;
334 hr =
D3DXCreateFontA(
device, 12, 0,
FW_DONTCARE, 0,
FALSE,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH,
"Arial", &
font);
340 hr =
D3DXCreateFontA(
device, 0, 0,
FW_DONTCARE, 0,
FALSE,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH,
"Arial", &
font);
344 hr =
D3DXCreateFontA(
device, 12, 0,
FW_DONTCARE, 0,
FALSE,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH,
NULL, &
font);
348 hr =
D3DXCreateFontA(
device, 12, 0,
FW_DONTCARE, 0,
FALSE,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH,
"", &
font);
352 hr =
D3DXCreateFontA(
NULL, 12, 0,
FW_DONTCARE, 0,
FALSE,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH,
"Arial", &
font);
355 hr =
D3DXCreateFontA(
device, 12, 0,
FW_DONTCARE, 0,
FALSE,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH,
"Arial",
NULL);
358 hr =
D3DXCreateFontA(
NULL, 12, 0,
FW_DONTCARE, 0,
FALSE,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH,
"Arial",
NULL);
388 hr =
D3DXCreateFontA(
device, 12, 0,
FW_DONTCARE, 0,
FALSE,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH,
"Arial", &
font);
390 IDirect3DDevice9 *bufdev;
401 }
else skip(
"Failed to create a ID3DXFont object\n");
405 hr =
D3DXCreateFontA(
device, 12, 8,
FW_BOLD, 2,
TRUE,
ANSI_CHARSET,
OUT_RASTER_PRECIS,
ANTIALIASED_QUALITY,
VARIABLE_PITCH,
"Arial", &
font);
413 ok(
desc.Height == 12,
"ID3DXFont_GetDesc returned font height %d, expected %d\n",
desc.Height, 12);
414 ok(
desc.Width == 8,
"ID3DXFont_GetDesc returned font width %d, expected %d\n",
desc.Width, 8);
416 ok(
desc.MipLevels == 2,
"ID3DXFont_GetDesc returned font miplevels %d, expected %d\n",
desc.MipLevels, 2);
417 ok(
desc.Italic ==
TRUE,
"ID3DXFont_GetDesc says Italic was %d, but Italic should be %d\n",
desc.Italic,
TRUE);
422 ok(
strcmp(
desc.FaceName,
"Arial") == 0,
"ID3DXFont_GetDesc returned facename \"%s\", expected \"%s\"\n",
desc.FaceName,
"Arial");
425 }
else skip(
"Failed to create a ID3DXFont object\n");
429 hr =
D3DXCreateFontA(
device, 12, 0,
FW_DONTCARE, 0,
FALSE,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH,
"Arial", &
font);
434 ok(
hdc !=
NULL,
"ID3DXFont_GetDC returned an invalid handle\n");
440 ok(
ret,
"ID3DXFont_GetTextMetricsA failed\n");
442 ok(
ret,
"GetTextMetricsA failed\n");
466 }
else skip(
"Failed to create a ID3DXFont object\n");
470 hr =
D3DXCreateFontA(
device, 12, 0,
FW_DONTCARE, 0,
FALSE,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH,
"Arial", &
font);
493 }
else skip(
"Failed to create a ID3DXFont object\n");
497 hr =
D3DXCreateFontA(
device, 12, 0,
FW_DONTCARE, 0,
FALSE,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH,
"Arial", &
font);
520 ok(
hr ==
D3D_OK,
"ID3DXFont_PreloadCharacters returned %#x, expected %#x\n",
hr,
D3D_OK);
525 ok(
hr ==
D3D_OK,
"ID3DXFont_PreloadCharacters returned %#x, expected %#x\n",
hr,
D3D_OK);
527 for(
c =
'b';
c <=
'z';
c++) {
542 ok(
hr ==
D3D_OK,
"IDirect3DTexture9_GetLevelDesc failed\n");
544 ok(
desc.Usage == 0,
"Got usage %#x, expected %#x\n",
desc.Usage, 0);
545 ok(
desc.Width == 256,
"Got width %u, expected %u\n",
desc.Width, 256);
546 ok(
desc.Height == 256,
"Got height %u, expected %u\n",
desc.Height, 256);
554 ok(
hr ==
D3D_OK,
"ID3DXFont_PreloadCharacters returned %#x, expected %#x\n",
hr,
D3D_OK);
557 }
else skip(
"Failed to create a ID3DXFont object\n");
571 skip(
"Failed to create a ID3DXFont object\n");
587 ok(
levels ==
tests[
i].expected_levels,
"Got levels %u, expected %u\n",
590 ok(
hr ==
D3D_OK,
"IDirect3DTexture9_GetLevelDesc failed\n");
592 ok(
desc.Usage == 0,
"Got usage %#x, expected %#x\n",
desc.Usage, 0);
593 ok(
desc.Width ==
tests[
i].expected_size,
"Got width %u, expected %u\n",
595 ok(
desc.Height ==
tests[
i].expected_size,
"Got height %u, expected %u\n",
629 ok(!
rect.left,
"Got unexpected rect left %d.\n",
rect.left);
630 ok(!
rect.top,
"Got unexpected rect top %d.\n",
rect.top);
643 hr =
D3DXCreateFontA(
device, 12, 0,
FW_DONTCARE, 0,
FALSE,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH,
"Arial", &
font);
651 ok(
height == 12,
"DrawTextA returned %d, expected 12.\n",
height);
654 ok(
height == 12,
"DrawTextA returned %d, expected 12.\n",
height);
660 ok(
height == 12,
"DrawTextA returned %d, expected 12.\n",
height);
663 ok(
height == 12,
"DrawTextA returned %d, expected 12.\n",
height);
666 ok(
height == 12,
"DrawTextA returned %d, expected 12.\n",
height);
669 ok(
height == 12,
"DrawTextA returned %d, expected 12.\n",
height);
676 ok(
height == 12,
"DrawTextW returned %d, expected 12.\n",
height);
680 ok(
height == 12,
"DrawTextW returned %d, expected 12.\n",
height);
686 ok(
height == 12,
"DrawTextW returned %d, expected 12.\n",
height);
689 ok(
height == 12,
"DrawTextW returned %d, expected 12.\n",
height);
692 ok(
height == 12,
"DrawTextA returned %d, expected 12.\n",
height);
695 ok(
height == 12,
"DrawTextA returned %d, expected 12.\n",
height);
#define ANTIALIASED_QUALITY
#define IDirect3DDevice9_Clear(p, a, b, c, d, e, f)
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
DWORD WINAPI GetGlyphIndicesA(_In_ HDC hdc, _In_reads_(c) LPCSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
static struct test_info tests[]
#define IDirect3DTexture9_Release(p)
#define ID3DXFont_GetDescA(p, a)
#define D3DERR_INVALIDCALL
#define IDirect3DTexture9_GetLevelCount(p)
static int get_ref(IUnknown *obj)
#define IDirect3DTexture9_GetLevelDesc(p, a, b)
static const CHAR testA[]
static const WCHAR desc[]
#define ID3DXFont_GetDC(p)
#define ID3DXFont_GetTextMetricsA(p, a)
#define check_ref(obj, exp)
HRESULT WINAPI D3DXCreateFontIndirectA(IDirect3DDevice9 *device, const D3DXFONT_DESCA *desc, ID3DXFont **font)
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
#define IDirect3DDevice9_EndScene(p)
#define ID3DXFont_PreloadGlyphs(p, a, b)
#define ID3DXFont_PreloadCharacters(p, a, b)
#define ID3DXSprite_End(p)
#define OUT_DEFAULT_PRECIS
struct ID3DXFont ID3DXFont
#define ID3DXSprite_Release(p)
#define ID3DXSprite_Begin(p, a)
static int font_height(HFONT hFont)
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
#define ID3DXFont_PreloadTextA(p, a, b)
#define ID3DXFont_DrawTextW(p, a, b, c, d, e, f)
#define ID3DXFont_PreloadTextW(p, a, b)
GLint GLint GLsizei GLsizei height
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define ID3DXFont_Release(p)
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
HRESULT WINAPI D3DXCreateSprite(struct IDirect3DDevice9 *device, struct ID3DXSprite **sprite)
#define OUT_RASTER_PRECIS
char * strcpy(char *DstString, const char *SrcString)
int strcmp(const char *String1, const char *String2)
#define ID3DXFont_DrawTextA(p, a, b, c, d, e, f)
HRESULT WINAPI D3DXCreateFontA(struct IDirect3DDevice9 *device, INT height, UINT width, UINT weight, UINT miplevels, BOOL italic, DWORD charset, DWORD precision, DWORD quality, DWORD pitchandfamily, const char *facename, struct ID3DXFont **font)
#define check_release(obj, exp)
#define ID3DXFont_GetGlyphData(p, a, b, c, d)
#define IDirect3DDevice9_BeginScene(p)
#define ID3DXFont_GetDevice(p, a)
static const WCHAR testW[]
#define D3DXSPRITE_ALPHABLEND