ReactOS 0.4.15-dev-7953-g1f49173
GetGlyphOutline.c File Reference
#include "precomp.h"
Include dependency graph for GetGlyphOutline.c:

Go to the source code of this file.

Classes

struct  TEST_ENTRY
 

Macros

#define WCH0   0
 
#define WCH1   0xFFFF
 
#define WCH2   L'A'
 
#define WCH3   L'T'
 
#define WCH4   L'g'
 
#define WCH5   L'.'
 

Typedefs

typedef struct TEST_ENTRY TEST_ENTRY
 

Functions

void DoEntry (const TEST_ENTRY *pEntry)
 
 START_TEST (GetGlyphOutline)
 

Variables

static const MAT2 s_mat = { {0,1}, {0,0}, {0,0}, {0,1} }
 
static BYTE s_ab [512]
 
static const TEST_ENTRY s_entries []
 

Macro Definition Documentation

◆ WCH0

#define WCH0   0

Definition at line 29 of file GetGlyphOutline.c.

◆ WCH1

#define WCH1   0xFFFF

Definition at line 30 of file GetGlyphOutline.c.

◆ WCH2

#define WCH2   L'A'

Definition at line 31 of file GetGlyphOutline.c.

◆ WCH3

#define WCH3   L'T'

Definition at line 32 of file GetGlyphOutline.c.

◆ WCH4

#define WCH4   L'g'

Definition at line 33 of file GetGlyphOutline.c.

◆ WCH5

#define WCH5   L'.'

Definition at line 34 of file GetGlyphOutline.c.

Typedef Documentation

◆ TEST_ENTRY

Function Documentation

◆ DoEntry()

void DoEntry ( const TEST_ENTRY pEntry)

Definition at line 301 of file GetGlyphOutline.c.

302{
303 LOGFONTW lf;
304 HFONT hFont;
305 HDC hDC;
306 HGDIOBJ hFontOld;
307
308 ZeroMemory(&lf, sizeof(lf));
309
310 lf.lfHeight = pEntry->lfHeight;
312 lstrcpyW(lf.lfFaceName, pEntry->lfFaceName);
313
315 ok(hFont != NULL, "hFont was NULL\n");
316 if (hFont == NULL)
317 {
318 skip("Line %d: skipped because hFont == NULL\n", pEntry->line);
319 return;
320 }
321
323 ok(hDC != NULL, "hDC was NULL\n");
324 if (hDC == NULL)
325 {
326 skip("Line %d: skipped because hDC == NULL\n", pEntry->line);
328 return;
329 }
330
331 hFontOld = SelectObject(hDC, hFont);
332 ok(hFontOld != NULL, "SelectObject failed\n");
333 if (hFontOld == NULL)
334 {
335 skip("Line %d: skipped because SelectObject failed\n", pEntry->line);
336 }
337 else
338 {
339 DWORD dwRet, dwError;
340 GLYPHMETRICS gm;
341
342 SetLastError(0xDEADBEEF);
343
344 if (pEntry->bMetrics)
345 {
346 FillMemory(&gm, sizeof(gm), 0xCD);
347 dwRet = GetGlyphOutlineW(hDC, pEntry->wch, pEntry->uFormat, &gm, pEntry->cbBuffer, pEntry->lpvBuffer, &s_mat);
348 }
349 else
350 {
351 dwRet = GetGlyphOutlineW(hDC, pEntry->wch, pEntry->uFormat, NULL, pEntry->cbBuffer, pEntry->lpvBuffer, &s_mat);
352 }
353 dwError = GetLastError();
354
355 ok(dwRet == pEntry->dwRet, "Line %d: dwRet expected 0x%lX, was 0x%lX\n", pEntry->line, pEntry->dwRet, dwRet);
356 ok(dwError == pEntry->dwError, "Line %d: dwError expected 0x%lX, was 0x%lX\n", pEntry->line, pEntry->dwError, dwError);
357
358 if (pEntry->bMetrics)
359 {
360 ok(gm.gmBlackBoxX == pEntry->gm.gmBlackBoxX, "Line %d: gm.gmBlackBoxX expected 0x%X, was 0x%X\n", pEntry->line, pEntry->gm.gmBlackBoxX, gm.gmBlackBoxX);
361 ok(gm.gmBlackBoxY == pEntry->gm.gmBlackBoxY, "Line %d: gm.gmBlackBoxY expected 0x%X, was 0x%X\n", pEntry->line, pEntry->gm.gmBlackBoxY, gm.gmBlackBoxY);
362 ok(gm.gmptGlyphOrigin.x == pEntry->gm.gmptGlyphOrigin.x, "Line %d: gm.gmptGlyphOrigin.x expected %ld, was %ld\n", pEntry->line, pEntry->gm.gmptGlyphOrigin.x, gm.gmptGlyphOrigin.x);
363 ok(gm.gmptGlyphOrigin.y == pEntry->gm.gmptGlyphOrigin.y, "Line %d: gm.gmptGlyphOrigin.y expected %ld, was %ld\n", pEntry->line, pEntry->gm.gmptGlyphOrigin.y, gm.gmptGlyphOrigin.y);
364 ok(gm.gmCellIncX == pEntry->gm.gmCellIncX, "Line %d: gm.gmCellIncX expected %d, was %d\n", pEntry->line, pEntry->gm.gmCellIncX, gm.gmCellIncX);
365 ok(gm.gmCellIncY == pEntry->gm.gmCellIncY, "Line %d: gm.gmCellIncY expected %d, was %d\n", pEntry->line, pEntry->gm.gmCellIncY, gm.gmCellIncY);
366 }
367 SelectObject(hDC, hFontOld);
368 }
369
371 DeleteDC(hDC);
372}
static HDC hDC
Definition: 3dtext.c:33
static const MAT2 s_mat
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
HFONT hFont
Definition: main.c:53
#define NULL
Definition: types.h:112
#define SetLastError(x)
Definition: compat.h:752
#define lstrcpyW
Definition: compat.h:749
#define FillMemory(BUF, SIZ, MASK)
Definition: strucsup.c:31
unsigned long DWORD
Definition: ntddk_ex.h:95
PLIST_ENTRY pEntry
Definition: fxioqueue.cpp:4484
pKey DeleteObject()
static HDC
Definition: imagelist.c:92
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
LONG lfHeight
Definition: dimm.idl:59
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
BYTE lfCharSet
Definition: dimm.idl:67
short gmCellIncX
Definition: wingdi.h:2445
UINT gmBlackBoxY
Definition: wingdi.h:2443
UINT gmBlackBoxX
Definition: wingdi.h:2442
short gmCellIncY
Definition: wingdi.h:2446
POINT gmptGlyphOrigin
Definition: wingdi.h:2444
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define ZeroMemory
Definition: winbase.h:1712
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define DEFAULT_CHARSET
Definition: wingdi.h:384
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
BOOL WINAPI DeleteDC(_In_ HDC)
DWORD WINAPI GetGlyphOutlineW(_In_ HDC hdc, _In_ UINT uChar, _In_ UINT fuFormat, _Out_ LPGLYPHMETRICS lpgm, _In_ DWORD cjBuffer, _Out_writes_bytes_opt_(cjBuffer) LPVOID pvBuffer, _In_ CONST MAT2 *lpmat2)

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( GetGlyphOutline  )

Definition at line 374 of file GetGlyphOutline.c.

375{
377 for (i = 0; i < count; ++i)
378 {
380 }
381}
void DoEntry(const TEST_ENTRY *pEntry)
static const TEST_ENTRY s_entries[]
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
GLuint GLuint GLsizei count
Definition: gl.h:1545
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
Definition: glfuncs.h:248
ULONG_PTR SIZE_T
Definition: typedefs.h:80

Variable Documentation

◆ s_ab

BYTE s_ab[512]
static

Definition at line 27 of file GetGlyphOutline.c.

◆ s_entries

const TEST_ENTRY s_entries[]
static

Definition at line 36 of file GetGlyphOutline.c.

Referenced by START_TEST().

◆ s_mat

const MAT2 s_mat = { {0,1}, {0,0}, {0,0}, {0,1} }
static

Definition at line 25 of file GetGlyphOutline.c.

Referenced by DoEntry().