2 * PROJECT: ReactOS api tests
3 * LICENSE: GPL - See COPYING in the top level directory
4 * PURPOSE: Test for GdiGetCharDimensions
5 * PROGRAMMERS: Timo Kreuzer
10 void Test_GdiGetCharDimensions()
12 LOGFONT logfont
= {-11, 0, 0, 0, 400,
13 0, 0, 0, 0, 0, 0, 0, 0,
15 HFONT hFont
, hOldFont
;
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};
25 hFont
= CreateFontIndirect(&logfont
);
26 hdc
= CreateCompatibleDC(NULL
);
27 hOldFont
= SelectObject(hdc
, hFont
);
29 x
= GdiGetCharDimensions(hdc
, &tm
, &y
);
30 GetTextExtentPointW(hdc
, alphabet
, 52, &size
);
31 x2
= (size
.cx
/ 26 + 1) / 2;
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
);
36 SelectObject(hdc
, hOldFont
);
41 START_TEST(GdiGetCharDimensions
)
43 Test_GdiGetCharDimensions();