ReactOS  0.4.15-dev-439-g292f67a
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 
314  hFont = CreateFontIndirectW(&lf);
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 }
DWORD dwError
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
static const MAT2 s_mat
GLYPHMETRICS gm
LONG lfHeight
Definition: dimm.idl:59
BYTE lfCharSet
Definition: dimm.idl:67
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define ZeroMemory
Definition: winbase.h:1648
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
short gmCellIncY
Definition: wingdi.h:2445
#define DEFAULT_CHARSET
Definition: wingdi.h:383
HFONT hFont
Definition: main.c:53
DWORD cbBuffer
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)
smooth NULL
Definition: ftsmooth.c:416
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
UINT uFormat
BOOL bMetrics
POINT gmptGlyphOrigin
Definition: wingdi.h:2443
DWORD dwRet
INT line
Definition: cmd.c:14
unsigned long DWORD
Definition: ntddk_ex.h:95
WCHAR wch
#define FillMemory(BUF, SIZ, MASK)
Definition: strucsup.c:31
#define SetLastError(x)
Definition: compat.h:418
short gmCellIncX
Definition: wingdi.h:2444
LPCWSTR lfFaceName
static HDC hDC
Definition: 3dtext.c:33
#define lstrcpyW
Definition: compat.h:415
BOOL WINAPI DeleteDC(_In_ HDC)
#define ok(value,...)
Definition: atltest.h:57
LONG lfHeight
UINT gmBlackBoxY
Definition: wingdi.h:2442
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define skip(...)
Definition: atltest.h:64
UINT gmBlackBoxX
Definition: wingdi.h:2441
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
LPVOID lpvBuffer

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  {
379  DoEntry(&s_entries[i]);
380  }
381 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
static const TEST_ENTRY s_entries[]
void DoEntry(const TEST_ENTRY *pEntry)
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:79

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().