ReactOS  0.4.15-dev-1070-ge1a01de
GdiGetCharDimensions.c File Reference
#include "precomp.h"
Include dependency graph for GdiGetCharDimensions.c:

Go to the source code of this file.

Functions

void Test_GdiGetCharDimensions ()
 
 START_TEST (GdiGetCharDimensions)
 

Function Documentation

◆ START_TEST()

START_TEST ( GdiGetCharDimensions  )

Definition at line 41 of file GdiGetCharDimensions.c.

42 {
44 }
void Test_GdiGetCharDimensions()

◆ Test_GdiGetCharDimensions()

void Test_GdiGetCharDimensions ( )

Definition at line 10 of file GdiGetCharDimensions.c.

11 {
12  LOGFONT logfont = {-11, 0, 0, 0, 400,
13  0, 0, 0, 0, 0, 0, 0, 0,
14  "MS Shell Dlg 2"};
15  HFONT hFont, hOldFont;
16  HDC hdc;
17  LONG x, y, x2;
19  SIZE size;
20  static const WCHAR alphabet[] = {
21  'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q',
22  'r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H',
23  'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',0};
24 
25  hFont = CreateFontIndirect(&logfont);
27  hOldFont = SelectObject(hdc, hFont);
28 
29  x = GdiGetCharDimensions(hdc, &tm, &y);
30  GetTextExtentPointW(hdc, alphabet, 52, &size);
31  x2 = (size.cx / 26 + 1) / 2;
32 
33  ok(x == x2, "x=%ld, x2=%ld\n", x, x2);
34  ok(y == tm.tmHeight, "y = %ld, tm.tmHeight = %ld\n", y, tm.tmHeight);
35 
36  SelectObject(hdc, hOldFont);
38  DeleteDC(hdc);
39 }
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
HFONT hFont
Definition: main.c:53
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
HDC hdc
Definition: main.c:9
Definition: time.h:76
LONG WINAPI GdiGetCharDimensions(HDC, LPTEXTMETRICW, LONG *)
Definition: font.c:2145
BOOL WINAPI DeleteDC(_In_ HDC)
#define ok(value,...)
Definition: atltest.h:57
#define CreateFontIndirect
Definition: wingdi.h:4443
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
BOOL WINAPI GetTextExtentPointW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE lpsz)

Referenced by START_TEST().