ReactOS  0.4.14-dev-384-g5b37caa
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 335 of file GetGlyphOutline.c.

336 {
337  LOGFONTW lf;
338  HFONT hFont;
339  HDC hDC;
340  HGDIOBJ hFontOld;
341 
342  ZeroMemory(&lf, sizeof(lf));
343 
344  lf.lfHeight = pEntry->lfHeight;
346  lstrcpyW(lf.lfFaceName, pEntry->lfFaceName);
347 
348  hFont = CreateFontIndirectW(&lf);
349  ok(hFont != NULL, "hFont was NULL\n");
350  if (hFont == NULL)
351  {
352  skip("Line %d: skipped because hFont == NULL\n", pEntry->line);
353  return;
354  }
355 
357  ok(hDC != NULL, "hDC was NULL\n");
358  if (hDC == NULL)
359  {
360  skip("Line %d: skipped because hDC == NULL\n", pEntry->line);
362  return;
363  }
364 
365  hFontOld = SelectObject(hDC, hFont);
366  ok(hFontOld != NULL, "SelectObject failed\n");
367  if (hFontOld == NULL)
368  {
369  skip("Line %d: skipped because SelectObject failed\n", pEntry->line);
370  }
371  else
372  {
373  DWORD dwRet, dwError;
374  GLYPHMETRICS gm;
375 
376  SetLastError(0xDEADBEEF);
377 
378  if (pEntry->bMetrics)
379  {
380  FillMemory(&gm, sizeof(gm), 0xCD);
381  dwRet = GetGlyphOutlineW(hDC, pEntry->wch, pEntry->uFormat, &gm, pEntry->cbBuffer, pEntry->lpvBuffer, &s_mat);
382  }
383  else
384  {
385  dwRet = GetGlyphOutlineW(hDC, pEntry->wch, pEntry->uFormat, NULL, pEntry->cbBuffer, pEntry->lpvBuffer, &s_mat);
386  }
387  dwError = GetLastError();
388 
389  ok(dwRet == pEntry->dwRet, "Line %d: dwRet expected 0x%lX, was 0x%lX\n", pEntry->line, pEntry->dwRet, dwRet);
390  ok(dwError == pEntry->dwError, "Line %d: dwError expected 0x%lX, was 0x%lX\n", pEntry->line, pEntry->dwError, dwError);
391 
392  if (pEntry->bMetrics)
393  {
394  ok(gm.gmBlackBoxX == pEntry->gm.gmBlackBoxX, "Line %d: gm.gmBlackBoxX expected 0x%X, was 0x%X\n", pEntry->line, pEntry->gm.gmBlackBoxX, gm.gmBlackBoxX);
395  ok(gm.gmBlackBoxY == pEntry->gm.gmBlackBoxY, "Line %d: gm.gmBlackBoxY expected 0x%X, was 0x%X\n", pEntry->line, pEntry->gm.gmBlackBoxY, gm.gmBlackBoxY);
396  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);
397  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);
398  ok(gm.gmCellIncX == pEntry->gm.gmCellIncX, "Line %d: gm.gmCellIncX expected %d, was %d\n", pEntry->line, pEntry->gm.gmCellIncX, gm.gmCellIncX);
399  ok(gm.gmCellIncY == pEntry->gm.gmCellIncY, "Line %d: gm.gmCellIncY expected %d, was %d\n", pEntry->line, pEntry->gm.gmCellIncY, gm.gmCellIncY);
400  }
401  SelectObject(hDC, hFontOld);
402  }
403 
405  DeleteDC(hDC);
406 }
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:1642
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
short gmCellIncY
Definition: wingdi.h:2441
#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:2439
DWORD dwRet
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:417
INT line
Definition: cmd.c:14
short gmCellIncX
Definition: wingdi.h:2440
LPCWSTR lfFaceName
static HDC hDC
Definition: 3dtext.c:33
#define lstrcpyW
Definition: compat.h:414
BOOL WINAPI DeleteDC(_In_ HDC)
#define ok(value,...)
Definition: atltest.h:57
LONG lfHeight
UINT gmBlackBoxY
Definition: wingdi.h:2438
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define skip(...)
Definition: atltest.h:64
UINT gmBlackBoxX
Definition: wingdi.h:2437
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
LPVOID lpvBuffer

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( GetGlyphOutline  )

Definition at line 408 of file GetGlyphOutline.c.

409 {
411  for (i = 0; i < count; ++i)
412  {
413  DoEntry(&s_entries[i]);
414  }
415 }
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:78

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