ReactOS 0.4.16-dev-136-g52192f1
TextTransform.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS api tests
3 * LICENSE: GPL - See COPYING in the top level directory
4 * PURPOSE: Test for World Transformation and font rendering
5 * PROGRAMMERS: Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6 */
7
8#include "precomp.h"
9
10//#define DEBUGGING
11
12typedef struct tagBITMAPINFOEX
13{
17
18#ifdef DEBUGGING
19static BOOL SaveBitmapToFile(LPCWSTR pszFileName, HBITMAP hbm)
20{
21 BOOL f;
23 BITMAPINFOEX bmi;
24 BITMAPINFOHEADER *pbmih;
25 DWORD cb, cbColors;
26 HDC hDC;
28 LPVOID pBits;
29 BITMAP bm;
30
31 if (!GetObjectW(hbm, sizeof(BITMAP), &bm))
32 return FALSE;
33
34 pbmih = &bmi.bmiHeader;
35 ZeroMemory(pbmih, sizeof(BITMAPINFOHEADER));
36 pbmih->biSize = sizeof(BITMAPINFOHEADER);
37 pbmih->biWidth = bm.bmWidth;
38 pbmih->biHeight = bm.bmHeight;
39 pbmih->biPlanes = 1;
40 pbmih->biBitCount = bm.bmBitsPixel;
41 pbmih->biCompression = BI_RGB;
42 pbmih->biSizeImage = bm.bmWidthBytes * bm.bmHeight;
43
44 if (bm.bmBitsPixel < 16)
45 cbColors = (1 << bm.bmBitsPixel) * sizeof(RGBQUAD);
46 else
47 cbColors = 0;
48
49 bf.bfType = 0x4d42;
50 bf.bfReserved1 = 0;
51 bf.bfReserved2 = 0;
52 cb = sizeof(BITMAPFILEHEADER) + pbmih->biSize + cbColors;
53 bf.bfOffBits = cb;
54 bf.bfSize = cb + pbmih->biSizeImage;
55
56 pBits = HeapAlloc(GetProcessHeap(), 0, pbmih->biSizeImage);
57 if (pBits == NULL)
58 return FALSE;
59
60 f = FALSE;
62 if (hDC)
63 {
64 if (GetDIBits(hDC, hbm, 0, bm.bmHeight, pBits, (BITMAPINFO *)&bmi,
66 {
71 {
72 f = WriteFile(hFile, &bf, sizeof(BITMAPFILEHEADER), &cb, NULL) &&
73 WriteFile(hFile, &bmi, sizeof(BITMAPINFOHEADER), &cb, NULL) &&
74 WriteFile(hFile, bmi.bmiColors, cbColors, &cb, NULL) &&
75 WriteFile(hFile, pBits, pbmih->biSizeImage, &cb, NULL);
77
78 if (!f)
80 }
81 }
83 }
84 HeapFree(GetProcessHeap(), 0, pBits);
85 return f;
86}
87#endif
88
89typedef struct TEST_ENTRY
90{
91 INT line; // line number
92 LONG lfWidth; // LOGFONT.lfWidth
93 LONG lfEscapement; // LOGFONT.lfEscapement
94 INT GraphicsMode; // GM_COMPATIBLE or GM_ADVANCED
95 POINT ptRef; // reference point
101
102#define WIDTH 200
103#define HEIGHT 200
104#define XCENTER (WIDTH / 2)
105#define YCENTER (HEIGHT / 2)
106#define BLACK RGB(0, 0, 0)
107#define WHITE RGB(255, 255, 255)
108#define LFHEIGHT -50
109#define LFWIDTH1 100
110#define LFESCAPE1 (-90 * 10)
111
112static const RECT s_rc = {0, 0, WIDTH, HEIGHT};
113static HBRUSH s_hWhiteBrush = NULL;
114static HPEN s_hRedPen = NULL;
115
116static const TEST_ENTRY s_entries[] =
117{
118 // GM_COMPATIBLE TA_BOTTOM
119 {__LINE__, 0, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, 1, 0, 0}, FALSE, {7, 8}},
120 {__LINE__, 0, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {-1, 0, 0, 1, 0, 0}, FALSE, {7, 8}},
121 {__LINE__, 0, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, -1, 0, 0}, FALSE, {7, 8}},
122 {__LINE__, 0, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 1, 1, 0, 0, 0}, FALSE, {7, 8}},
123 {__LINE__, 0, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, -1, -1, 0, 0, 0}, FALSE, {7, 8}},
124 {__LINE__, 0, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 1, 1, 1, 0, 0}, FALSE, {7, 8}},
125 {__LINE__, 0, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 0, 0, 0, 0, 0}, FALSE, {7, 8}},
126 {__LINE__, LFWIDTH1, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, 1, 0, 0}, FALSE, {7, 8}},
127 {__LINE__, LFWIDTH1, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {-1, 0, 0, 1, 0, 0}, FALSE, {7, 8}},
128 {__LINE__, LFWIDTH1, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, -1, 0, 0}, FALSE, {7, 8}},
129 {__LINE__, LFWIDTH1, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 1, 1, 0, 0, 0}, FALSE, {7, 8}},
130 {__LINE__, LFWIDTH1, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, -1, -1, 0, 0, 0}, FALSE, {7, 8}},
131 {__LINE__, LFWIDTH1, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 1, 1, 1, 0, 0}, FALSE, {7, 8}},
132 {__LINE__, LFWIDTH1, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 0, 0, 0, 0, 0}, FALSE, {7, 8}},
133 {__LINE__, LFWIDTH1, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, 1, 0, 0}, FALSE, {11, 15}},
134 {__LINE__, LFWIDTH1, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {-1, 0, 0, 1, 0, 0}, FALSE, {11, 15}},
135 {__LINE__, LFWIDTH1, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, -1, 0, 0}, FALSE, {11, 15}},
136 {__LINE__, LFWIDTH1, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 1, 1, 0, 0, 0}, FALSE, {11, 15}},
137 {__LINE__, LFWIDTH1, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, -1, -1, 0, 0, 0}, FALSE, {11, 15}},
138 {__LINE__, LFWIDTH1, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 1, 1, 1, 0, 0}, FALSE, {11, 15}},
139 {__LINE__, LFWIDTH1, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 0, 0, 0, 0, 0}, FALSE, {11, 15}},
140 {__LINE__, 0, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, 1, 0, 0}, FALSE, {11, 15}},
141 {__LINE__, 0, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {-1, 0, 0, 1, 0, 0}, FALSE, {11, 15}},
142 {__LINE__, 0, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, -1, 0, 0}, FALSE, {11, 15}},
143 {__LINE__, 0, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 1, 1, 0, 0, 0}, FALSE, {11, 15}},
144 {__LINE__, 0, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, -1, -1, 0, 0, 0}, FALSE, {11, 15}},
145 {__LINE__, 0, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 1, 1, 1, 0, 0}, FALSE, {11, 15}},
146 {__LINE__, 0, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 0, 0, 0, 0, 0}, FALSE, {11, 15}},
147
148 // GM_COMPATIBLE TA_TOP
149 {__LINE__, 0, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {1, 0, 0, 1, 0, 0}, FALSE, {11, 12}},
150 {__LINE__, 0, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {-1, 0, 0, 1, 0, 0}, FALSE, {11, 12}},
151 {__LINE__, 0, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {1, 0, 0, -1, 0, 0}, FALSE, {11, 12}},
152 {__LINE__, 0, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {0, 1, 1, 0, 0, 0}, FALSE, {11, 12}},
153 {__LINE__, 0, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {0, -1, -1, 0, 0, 0}, FALSE, {11, 12}},
154 {__LINE__, 0, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {1, 1, 1, 1, 0, 0}, FALSE, {11, 12}},
155 {__LINE__, 0, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {0, 0, 0, 0, 0, 0}, FALSE, {11, 12}},
156 {__LINE__, LFWIDTH1, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {1, 0, 0, 1, 0, 0}, FALSE, {11, 12}},
157 {__LINE__, LFWIDTH1, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {-1, 0, 0, 1, 0, 0}, FALSE, {11, 12}},
158 {__LINE__, LFWIDTH1, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {1, 0, 0, -1, 0, 0}, FALSE, {11, 12}},
159 {__LINE__, LFWIDTH1, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {0, 1, 1, 0, 0, 0}, FALSE, {11, 12}},
160 {__LINE__, LFWIDTH1, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {0, -1, -1, 0, 0, 0}, FALSE, {11, 12}},
161 {__LINE__, LFWIDTH1, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {1, 1, 1, 1, 0, 0}, FALSE, {11, 12}},
162 {__LINE__, LFWIDTH1, 0, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {0, 0, 0, 0, 0, 0}, FALSE, {11, 12}},
163 {__LINE__, LFWIDTH1, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {1, 0, 0, 1, 0, 0}, FALSE, {10, 14}},
164 {__LINE__, LFWIDTH1, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {-1, 0, 0, 1, 0, 0}, FALSE, {10, 14}},
165 {__LINE__, LFWIDTH1, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {1, 0, 0, -1, 0, 0}, FALSE, {10, 14}},
166 {__LINE__, LFWIDTH1, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {0, 1, 1, 0, 0, 0}, FALSE, {10, 14}},
167 {__LINE__, LFWIDTH1, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {0, -1, -1, 0, 0, 0}, FALSE, {10, 14}},
168 {__LINE__, LFWIDTH1, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {1, 1, 1, 1, 0, 0}, FALSE, {10, 14}},
169 {__LINE__, LFWIDTH1, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {0, 0, 0, 0, 0, 0}, FALSE, {10, 14}},
170 {__LINE__, 0, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {1, 0, 0, 1, 0, 0}, FALSE, {10, 14}},
171 {__LINE__, 0, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {-1, 0, 0, 1, 0, 0}, FALSE, {10, 14}},
172 {__LINE__, 0, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {1, 0, 0, -1, 0, 0}, FALSE, {10, 14}},
173 {__LINE__, 0, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {0, 1, 1, 0, 0, 0}, FALSE, {10, 14}},
174 {__LINE__, 0, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {0, -1, -1, 0, 0, 0}, FALSE, {10, 14}},
175 {__LINE__, 0, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {1, 1, 1, 1, 0, 0}, FALSE, {10, 14}},
176 {__LINE__, 0, LFESCAPE1, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {0, 0, 0, 0, 0, 0}, FALSE, {10, 14}},
177
178 // GM_ADVANCED TA_LEFT TA_BOTTOM
179 {__LINE__, 0, 0, GM_ADVANCED, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, 1, 0, 0}, TRUE, {7, 8}},
180 {__LINE__, 0, 0, GM_ADVANCED, {-XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {-1, 0, 0, 1, 0, 0}, TRUE, {5, 6}},
181 {__LINE__, 0, 0, GM_ADVANCED, {XCENTER, -YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, -1, 0, 0}, TRUE, {11, 12}},
182 {__LINE__, 0, 0, GM_ADVANCED, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 1, 1, 0, 0, 0}, TRUE, {10, 14}},
183 {__LINE__, 0, 0, GM_ADVANCED, {-XCENTER, -YCENTER}, TA_LEFT | TA_BOTTOM, {0, -1, -1, 0, 0, 0}, TRUE, {3, 7}},
184 {__LINE__, 0, 0, GM_ADVANCED, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 1, 1, 1, 0, 0}, FALSE, {7, 8}},
185 {__LINE__, 0, 0, GM_ADVANCED, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 0, 0, 0, 0, 0}, FALSE, {7, 8}},
186 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, 1, 0, 0}, TRUE, {7, 8}},
187 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {-XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {-1, 0, 0, 1, 0, 0}, TRUE, {5, 6}},
188 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {XCENTER, -YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, -1, 0, 0}, TRUE, {11, 12}},
189 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 1, 1, 0, 0, 0}, TRUE, {10, 14}},
190 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {-XCENTER, -YCENTER}, TA_LEFT | TA_BOTTOM, {0, -1, -1, 0, 0, 0}, TRUE, {3, 7}},
191 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 1, 1, 1, 0, 0}, FALSE, {7, 8}},
192 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 0, 0, 0, 0, 0}, FALSE, {7, 8}},
193 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, 1, 0, 0}, TRUE, {10, 11, 14, 15}},
194 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {-XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {-1, 0, 0, 1, 0, 0}, TRUE, {10, 11, 14, 15}},
195 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {XCENTER, -YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, -1, 0, 0}, TRUE, {2, 3, 6, 7}},
196 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 1, 1, 0, 0, 0}, TRUE, {7, 8, 11, 12}},
197 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {-XCENTER, -YCENTER}, TA_LEFT | TA_BOTTOM, {0, -1, -1, 0, 0, 0}, TRUE, {5, 6, 9, 10}},
198 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 1, 1, 1, 0, 0}, FALSE, {10, 11, 14, 15}},
199 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 0, 0, 0, 0, 0}, FALSE, {10, 11, 14, 15}},
200 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, 1, WIDTH/8, 0}, TRUE, {11, 15}},
201 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {-XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {-1, 0, 0, 1, WIDTH/8, 0}, TRUE, {11, 15}},
202 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {XCENTER, -YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, -1, WIDTH/8, 0}, TRUE, {3, 7}},
203 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 1, 1, 0, 0, HEIGHT/8}, TRUE, {11, 12}},
204 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {XCENTER, -YCENTER}, TA_LEFT | TA_BOTTOM, {0, 1, -1, 0, 0, HEIGHT/8}, TRUE, {9, 10}},
205 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {-XCENTER, -YCENTER}, TA_LEFT | TA_BOTTOM, {0, -1, -1, 0, 0, HEIGHT/8}, TRUE, {9, 10}},
206 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {XCENTER + WIDTH/8, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 1, 1, 1, 0, 0}, FALSE, {11, 15}},
207 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {XCENTER - WIDTH/8, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 0, 0, 0, 0, 0}, FALSE, {10, 14}},
208
209 // GM_ADVANCED TA_LEFT TA_TOP
210 {__LINE__, 0, 0, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {2, 0, 0, 1, 0, 0}, TRUE, {1, 2, 3, 4}},
211 {__LINE__, 0, 0, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {1, 0, 0, 2, 0, 0}, TRUE, {1, 2, 5, 6}},
212 {__LINE__, 0, 0, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {2, 0, 0, 1, WIDTH/4, 0}, TRUE, {2, 3, 4}},
213 {__LINE__, 0, 0, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {2, 0, 0, 1, 0, HEIGHT/4}, TRUE, {5, 6, 7, 8}},
214 {__LINE__, 0, 0, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {1, 0, 0, 2, 0, HEIGHT/4}, TRUE, {5, 6, 9, 10}},
215 {__LINE__, 0, 0, GM_ADVANCED, {0, YCENTER}, TA_LEFT | TA_TOP, {2, 0, 0, 1, 0, 0}, TRUE, {9, 10, 11, 12}},
216 {__LINE__, 0, 0, GM_ADVANCED, {0, YCENTER}, TA_LEFT | TA_TOP, {2, 0, 0, 1, WIDTH/4, 0}, TRUE, {10, 11, 12}},
217 {__LINE__, 0, 0, GM_ADVANCED, {0, YCENTER}, TA_LEFT | TA_TOP, {1, 0, 0, 2, WIDTH/4, -HEIGHT/2}, TRUE, {10, 11, 14, 15}},
218 {__LINE__, 0, 0, GM_ADVANCED, {0, YCENTER}, TA_LEFT | TA_TOP, {2, 0, 0, 1, 0, HEIGHT/4}, TRUE, {13, 14, 15, 16}},
219 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {1.25, 0, 0, 1, 0, 0}, TRUE, {1, 2, 4}},
220 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {1, 0, 0, 2, 0, 0}, TRUE, {1, 2, 3, 4, 5, 6, 7, 8}},
221 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {1.25, 0, 0, 1, WIDTH/4, 0}, TRUE, {2, 3}},
222 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {1.25, 0, 0, 1, 0, HEIGHT/4}, TRUE, {5, 6, 8}},
223 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {1, 0, 0, 2, 0, HEIGHT/4}, TRUE, {5, 6, 7, 8, 9, 10, 11, 12}},
224 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {0, YCENTER}, TA_LEFT | TA_TOP, {1.25, 0, 0, 1, 0, 0}, TRUE, {9, 10, 12}},
225 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {0, YCENTER}, TA_LEFT | TA_TOP, {1.25, 0, 0, 1, WIDTH/4, 0}, TRUE, {10, 11}},
226 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {0, YCENTER}, TA_LEFT | TA_TOP, {1, 0, 0, 2, WIDTH/4, -HEIGHT/2}, TRUE, {10, 11, 12, 14, 15, 16}},
227 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {0, YCENTER}, TA_LEFT | TA_TOP, {1.25, 0, 0, 1, 0, HEIGHT/4}, TRUE, {13, 14, 16}},
228 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {1.25, 0, 0, 1, 0, 0}, TRUE, {5, 9}},
229 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {1, 0, 0, 2, 0, 0}, TRUE, {9, 13}},
230 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {1.25, 0, 0, 1, WIDTH/4, 0}, TRUE, {5, 6, 9, 10}},
231 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {1.25, 0, 0, 1, 0, HEIGHT/4}, TRUE, {9, 13}},
232 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {1, 0, 0, 2, 0, HEIGHT/4}, TRUE, {13}},
233 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {0, YCENTER}, TA_LEFT | TA_TOP, {1.25, 0, 0, 1, 0, 0}, TRUE, {13}},
234 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {0, YCENTER}, TA_LEFT | TA_TOP, {1.25, 0, 0, 1, WIDTH/4, 0}, TRUE, {13, 14}},
235 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {2, 0, 0, 1, 0, 0}, TRUE, {5, 9}},
236 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {2, 0, 0, 1, WIDTH/4, 0}, TRUE, {5, 6, 9, 10}},
237 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {2, 0, 0, 1, 0, HEIGHT/4}, TRUE, {9, 13}},
238 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {1, 0, 0, 2, WIDTH/8, HEIGHT/4}, TRUE, {13}},
239 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {0, YCENTER}, TA_LEFT | TA_TOP, {2, 0, 0, 1, WIDTH/4, 0}, TRUE, {13, 14}},
240 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {0, YCENTER}, TA_LEFT | TA_TOP, {1.25, 0, 0, 1, WIDTH/8, 0}, TRUE, {13}},
241
242 // GM_ADVANCED TA_CENTER TA_TOP
243 {__LINE__, 0, 0, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {2, 0, 0, 1, -WIDTH/4, 0}, TRUE, {2, 3, 4}},
244 {__LINE__, 0, 0, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {1, 0, 0, 2, -WIDTH/4, 0}, TRUE, {1, 2, 5, 6}},
245 {__LINE__, 0, 0, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {1, 0, 0, 2, -WIDTH/4, HEIGHT/4}, TRUE, {5, 6, 9, 10}},
246 {__LINE__, 0, 0, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {2, 0, 0, 1, -WIDTH/4, HEIGHT/4}, TRUE, {6, 7, 8}},
247 {__LINE__, 0, 0, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {1, 0, 0, 2, -WIDTH/4, HEIGHT/8}, TRUE, {5, 6}},
248 {__LINE__, 0, 0, GM_ADVANCED, {XCENTER/2, YCENTER}, TA_CENTER | TA_TOP, {2, 0, 0, 2, WIDTH/4, -HEIGHT/2}, TRUE, {10, 11, 12, 14, 15, 16}},
249 {__LINE__, 0, 0, GM_ADVANCED, {XCENTER/2, YCENTER/2}, TA_CENTER | TA_TOP, {1, 0, 0, 2, 0, -HEIGHT/2}, TRUE, {1, 2, 5, 6}},
250 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {2, 0, 0, 1, WIDTH/8, 0}, TRUE, {2, 3, 4}},
251 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {1, 0, 0, 2, WIDTH/8, 0}, TRUE, {2, 4, 6, 8}},
252 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {1.25, 0, 0, 1, -WIDTH/4, HEIGHT/4}, TRUE, {5, 7, 8}},
253 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {1, 0, 0, 2, WIDTH/8, HEIGHT/4}, TRUE, {6, 8, 10, 12}},
254 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {0, YCENTER}, TA_CENTER | TA_TOP, {1.25, 0, 0, 2, WIDTH/8, -HEIGHT/2}, TRUE, {10, 11, 14, 15}},
255 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {0, YCENTER}, TA_CENTER | TA_TOP, {1, 0, 0, 2, WIDTH/4, -HEIGHT/2}, TRUE, {9, 10, 11, 13, 14, 15}},
256 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {2, 0, 0, 1, -WIDTH/8, 0}, TRUE, {3, 4, 7, 8}},
257 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {1, 0, 0, 1.25, 0, 0}, TRUE, {2, 3, 6, 7}},
258 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {1, 0, 0, 2, 0, 0}, TRUE, {2, 3, 6, 7, 10, 11, 14, 15}},
259 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {1.25, 0, 0, 1, -WIDTH/8, HEIGHT/4}, TRUE, {6, 7, 10, 11}},
260 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {1, 0, 0, 1.25, WIDTH/8, HEIGHT/4}, TRUE, {7, 11}},
261 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {2, 0, 0, 1, -WIDTH/4, 0}, TRUE, {3, 4, 7, 8}},
262 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {1, 0, 0, 2, WIDTH/8, HEIGHT/8}, TRUE, {7, 15}},
263 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {1, 0, 0, 2, WIDTH/8, -HEIGHT/8}, TRUE, {3, 11}},
264 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {2, 0, 0, 1, -WIDTH/4, HEIGHT/4}, TRUE, {7, 8, 11, 12}},
265 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {1, 0, 0, 1, WIDTH/8, HEIGHT/4}, TRUE, {7, 11}},
266
267 // GM_ADVANCED TA_RIGHT TA_TOP
268 {__LINE__, 0, 0, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {2, 0, 0, 1, -WIDTH/4, 0}, TRUE, {1, 2, 3}},
269 {__LINE__, 0, 0, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {2, 0, 0, 1, -WIDTH/4, HEIGHT/4}, TRUE, {5, 6, 7}},
270 {__LINE__, 0, 0, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {1, 0, 0, 2, WIDTH/4, HEIGHT/4}, TRUE, {6, 7, 10, 11}},
271 {__LINE__, 0, 0, GM_ADVANCED, {0, YCENTER}, TA_RIGHT | TA_TOP, {2, 0, 0, 1, WIDTH/2, -HEIGHT/2}, TRUE, {1, 2}},
272 {__LINE__, 0, 0, GM_ADVANCED, {0, YCENTER}, TA_RIGHT | TA_TOP, {2, 0, 0, 2, WIDTH, -HEIGHT/2}, TRUE, {9, 10, 11, 12, 13, 14, 15, 16}},
273 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {1.25, 0, 0, 1, -WIDTH/4, 0}, TRUE, {1}},
274 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {1.25, 0, 0, 1, -WIDTH/4, HEIGHT/4}, TRUE, {5}},
275 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {1, 0, 0, 2, WIDTH/4, HEIGHT/4}, TRUE, {5, 6, 7, 9, 10, 11}},
276 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {0, YCENTER}, TA_RIGHT | TA_TOP, {1.25, 0, 0, 1, WIDTH/2, -HEIGHT/2}, TRUE, {1, 2}},
277 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {0, YCENTER}, TA_RIGHT | TA_TOP, {1.25, 0, 0, 2, WIDTH, -HEIGHT/2}, TRUE, {9, 11, 12, 13, 15, 16}},
278 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {1.25, 0, 0, 1, -WIDTH/8, 0}, TRUE, {2, 3}},
279 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {1.25, 0, 0, 1, -WIDTH/8, HEIGHT/4}, TRUE, {2, 3, 6, 7}},
280 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {1, 0, 0, 1.25, WIDTH/4, HEIGHT/4}, TRUE, {3, 4, 7, 8}},
281 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {0, YCENTER}, TA_RIGHT | TA_TOP, {1.25, 0, 0, 1, WIDTH/2, -HEIGHT/4}, TRUE, {2, 3, 6, 7}},
282 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {0, YCENTER}, TA_RIGHT | TA_TOP, {1.25, 0, 0, 1.25, WIDTH, -HEIGHT/8}, TRUE, {8, 12}},
283 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {2, 0, 0, 1, -WIDTH/4, 0}, TRUE, {3, 4}},
284 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {2, 0, 0, 1, -WIDTH/4, HEIGHT/4}, TRUE, {3, 4, 7, 8}},
285 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {1, 0, 0, 1.25, WIDTH/8, HEIGHT/4}, TRUE, {3, 7}},
286 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {0, YCENTER}, TA_RIGHT | TA_TOP, {2, 0, 0, 1, WIDTH/2, -HEIGHT/2}, TRUE, {2, 3}},
287 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {0, YCENTER}, TA_RIGHT | TA_TOP, {2, 0, 0, 1.25, WIDTH, -HEIGHT/8}, TRUE, {8, 12}},
288
289 // GM_ADVANCED TA_BASELINE TA_BASELINE
290 {__LINE__, 0, 0, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_BASELINE, {2, 0, 0, 1, -WIDTH/4, HEIGHT/4}, TRUE, {1, 2, 3}},
291 {__LINE__, 0, 0, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_BASELINE, {1, 0, 0, 2, WIDTH/4, HEIGHT/4}, TRUE, {2, 3}},
292 {__LINE__, 0, 0, GM_ADVANCED, {0, YCENTER}, TA_RIGHT | TA_BASELINE, {2, 0, 0, 2, WIDTH, -HEIGHT/2}, TRUE, {1, 2, 3, 4, 5, 6, 7, 8}},
293 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_BASELINE, {1.25, 0, 0, 1, -WIDTH/4, HEIGHT/4}, TRUE, {1}},
294 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_BASELINE, {1, 0, 0, 2, WIDTH/4, HEIGHT/4}, TRUE, {1, 2, 3}},
295 {__LINE__, LFWIDTH1, 0, GM_ADVANCED, {0, YCENTER}, TA_RIGHT | TA_BASELINE, {1.25, 0, 0, 2, WIDTH, -HEIGHT/2}, TRUE, {1, 3, 4, 5, 7, 8}},
296 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_BASELINE, {2, 0, 0, 1, -WIDTH/8, HEIGHT/4}, TRUE, {3, 4}},
297 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_BASELINE, {1, 0, 0, 1.25, WIDTH/8, HEIGHT/4}, TRUE, {3}},
298 {__LINE__, LFWIDTH1, LFESCAPE1, GM_ADVANCED, {0, YCENTER}, TA_RIGHT | TA_BASELINE, {1.25, 0, 0, 2, WIDTH, -HEIGHT/2}, TRUE, {4, 8}},
299 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_BASELINE, {2, 0, 0, 1, -WIDTH/4, HEIGHT/4}, TRUE, {3, 4}},
300 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {0, YCENTER}, TA_RIGHT | TA_BASELINE, {1.25, 0, 0, 1, WIDTH/8, HEIGHT/4}, TRUE, {5, 9}},
301 {__LINE__, 0, LFESCAPE1, GM_ADVANCED, {0, YCENTER}, TA_RIGHT | TA_BASELINE, {2, 0, 0, 2, 0, -HEIGHT/8}, TRUE, {1, 9}},
302};
303
305{
306 HGDIOBJ hbmOld, hPenOld;
307 INT i, j;
308 BOOL ret;
309 static const WCHAR s_szBlackBoxes[] = L"gg";
310 LOGFONTA lf;
311 HFONT hFont;
312 HGDIOBJ hFontOld;
313
314 ZeroMemory(&lf, sizeof(lf));
315 lf.lfHeight = LFHEIGHT;
316 lf.lfWidth = entry->lfWidth;
317 lf.lfEscapement = entry->lfEscapement;
319 lstrcpyA(lf.lfFaceName, "Marlett");
321 ok(hFont != NULL, "hFont was NULL.\n");
322 hFontOld = SelectObject(hDC, hFont);
323
324 SetGraphicsMode(hDC, entry->GraphicsMode);
325
326 hbmOld = SelectObject(hDC, hbm);
327 {
329
331
332 hPenOld = SelectObject(hDC, s_hRedPen);
333 {
334 MoveToEx(hDC, XCENTER / 2, 0, NULL);
335 LineTo(hDC, XCENTER / 2, HEIGHT);
336
337 MoveToEx(hDC, XCENTER, 0, NULL);
339
340 MoveToEx(hDC, XCENTER * 3 / 2, 0, NULL);
341 LineTo(hDC, XCENTER * 3 / 2, HEIGHT);
342
343 MoveToEx(hDC, 0, YCENTER / 2, NULL);
344 LineTo(hDC, WIDTH, YCENTER / 2);
345
346 MoveToEx(hDC, 0, YCENTER, NULL);
348
349 MoveToEx(hDC, 0, YCENTER * 3 / 2, NULL);
350 LineTo(hDC, WIDTH, YCENTER * 3 / 2);
351 }
352 SelectObject(hDC, hPenOld);
353
354 ret = SetWorldTransform(hDC, &entry->xform);
355 ok(ret == entry->xform_ok, "Line %d: SetWorldTransform returned %d\n", entry->line, ret);
356
357 SetTextAlign(hDC, entry->TextAlign);
358
359 TextOutW(hDC, entry->ptRef.x, entry->ptRef.y, s_szBlackBoxes, lstrlenW(s_szBlackBoxes));
360
362
363#define POS(ix, iy) {(ix) * WIDTH/4 + WIDTH/8, (iy) * HEIGHT/4 + HEIGHT/8}
364
365 for (j = 0; j < 4; ++j)
366 {
367 for (i = 0; i < 4; ++i)
368 {
369 POINT pt = POS(i, j);
370 INT k = j * 4 + i + 1;
371 COLORREF rgb = GetPixel(hDC, pt.x, pt.y);
372 BOOL bFound = FALSE;
373 INT m;
374 for (m = 0; m < _countof(entry->aBlacks); ++m)
375 {
376 if (entry->aBlacks[m] == 0)
377 break;
378 if (entry->aBlacks[m] == k)
379 {
380 bFound = TRUE;
381 break;
382 }
383 }
384
385 if (bFound)
386 {
387 ok(rgb == RGB(0, 0, 0), "Line %d: It was not black (k: %d)\n", entry->line, k);
388 }
389 else
390 {
391 ok(rgb != RGB(0, 0, 0), "Line %d: It was black (k: %d)\n", entry->line, k);
392 }
393
394#ifdef DEBUGGING
395 {
396 WCHAR sz[8];
397 RECT rc;
398 COLORREF colorOld;
400 if (rgb == RGB(0, 0, 0))
401 {
402 if (!bFound)
403 printf("Line %d: k: %d\n", entry->line, k);
404 }
405 Ellipse(hDC, pt.x - 10, pt.y - 10, pt.x + 10, pt.y + 10);
406 SetRect(&rc, pt.x - 10, pt.y - 10, pt.x + 10, pt.y + 10);
407 StringCchPrintfW(sz, _countof(sz), L"%d", k);
408 colorOld = SetTextColor(hDC, RGB(255, 0, 0));
411 SetTextColor(hDC, colorOld);
412 SelectObject(hDC, hFontOld);
413 }
414#endif
415 }
416 }
417 }
418 SelectObject(hDC, hbmOld);
419
420#ifdef DEBUGGING
421 {
422 WCHAR szFileName[MAX_PATH];
423 StringCchPrintfW(szFileName, _countof(szFileName), L"Line%04u.bmp", entry->line);
424 SaveBitmapToFile(szFileName, hbm);
425 }
426#endif
427
428 SelectObject(hDC, hFontOld);
430}
431
432START_TEST(TextTransform)
433{
434 HDC hDC;
435 BITMAPINFO bmi;
436 LPVOID pvBits;
437 HBITMAP hbm;
438 UINT i;
439
441 s_hRedPen = CreatePen(PS_SOLID, 2, RGB(255, 0, 0));
442
444 ok(hDC != NULL, "hDC was NULL.\n");
445
447
448 ZeroMemory(&bmi, sizeof(bmi));
449 bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
450 bmi.bmiHeader.biWidth = WIDTH;
452 bmi.bmiHeader.biPlanes = 1;
453 bmi.bmiHeader.biBitCount = 24;
454 hbm = CreateDIBSection(hDC, &bmi, DIB_RGB_COLORS, &pvBits, NULL, 0);
455 ok(hbm != NULL, "hbm was NULL.\n");
456
457 for (i = 0; i < _countof(s_entries); ++i)
458 {
460 }
461
463
466
467 DeleteDC(hDC);
468}
static HDC hDC
Definition: 3dtext.c:33
static void DoTestEntry(const TEST_ENTRY *entry, HDC hDC, HBITMAP hbm)
#define LFWIDTH1
static HBRUSH s_hWhiteBrush
static const RECT s_rc
#define LFESCAPE1
#define WIDTH
#define YCENTER
static const TEST_ENTRY s_entries[]
struct tagBITMAPINFOEX * LPBITMAPINFOEX
struct tagBITMAPINFOEX BITMAPINFOEX
#define XCENTER
struct TEST_ENTRY TEST_ENTRY
#define LFHEIGHT
#define POS(ix, iy)
static HPEN s_hRedPen
#define HEIGHT
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
HFONT hFont
Definition: main.c:53
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
Definition: blt.cpp:2
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define GetProcessHeap()
Definition: compat.h:736
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CreateFileW
Definition: compat.h:741
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define FILE_SHARE_READ
Definition: compat.h:136
#define lstrlenW
Definition: compat.h:750
#define FAR
Definition: zlib.h:34
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
#define pt(x, y)
Definition: drawing.c:79
#define BI_RGB
Definition: precomp.h:56
#define RGB(r, g, b)
Definition: precomp.h:71
ULONG RGBQUAD
Definition: precomp.h:59
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define printf
Definition: freeldr.h:97
pKey DeleteObject()
GLfloat f
Definition: glext.h:7540
const GLfloat * m
Definition: glext.h:10848
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
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 GLint GLint j
Definition: glfuncs.h:250
uint32_t entry
Definition: isohybrid.c:63
#define f
Definition: ke_i.h:83
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
#define CREATE_ALWAYS
Definition: disk.h:72
#define FILE_FLAG_WRITE_THROUGH
Definition: disk.h:47
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
int k
Definition: mpi.c:3369
_In_ HANDLE hFile
Definition: mswsock.h:90
unsigned int UINT
Definition: ndis.h:50
#define GENERIC_WRITE
Definition: nt_native.h:90
_In_ HBITMAP hbm
Definition: ntgdi.h:2776
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
#define _countof(array)
Definition: sndvol32.h:70
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
DWORD biCompression
Definition: amvideo.idl:35
DWORD biSizeImage
Definition: amvideo.idl:36
LONG lfHeight
Definition: dimm.idl:42
LONG lfEscapement
Definition: dimm.idl:44
BYTE lfCharSet
Definition: dimm.idl:50
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
LONG lfWidth
Definition: dimm.idl:43
Definition: cmd.c:13
INT line
Definition: cmd.c:14
BOOL xform_ok
Definition: TextTransform.c:98
BYTE aBlacks[16]
Definition: TextTransform.c:99
XFORM xform
Definition: TextTransform.c:97
LONG lfEscapement
Definition: TextTransform.c:93
POINT ptRef
Definition: TextTransform.c:95
INT GraphicsMode
Definition: TextTransform.c:94
INT TextAlign
Definition: TextTransform.c:96
LONG lfWidth
Definition: bl.h:1331
BITMAPINFOHEADER bmiHeader
Definition: TextTransform.c:14
RGBQUAD bmiColors[256]
Definition: TextTransform.c:15
USHORT biBitCount
Definition: precomp.h:46
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1476
RGBQUAD bmiColors[1]
Definition: wingdi.h:1477
int32_t INT
Definition: typedefs.h:58
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:44
int ret
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
Definition: bitmap.c:245
#define ZeroMemory
Definition: winbase.h:1712
_In_ ULONG _In_ ULONG rgb
Definition: winddi.h:3521
DWORD COLORREF
Definition: windef.h:300
#define GM_COMPATIBLE
Definition: wingdi.h:864
#define TA_NOUPDATECP
Definition: wingdi.h:935
#define DIB_RGB_COLORS
Definition: wingdi.h:367
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
BOOL WINAPI Ellipse(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
struct tagBITMAPFILEHEADER BITMAPFILEHEADER
int WINAPI SetGraphicsMode(_In_ HDC, _In_ int)
Definition: dc.c:1233
#define GM_ADVANCED
Definition: wingdi.h:865
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
int WINAPI GetDIBits(_In_ HDC hdc, _In_ HBITMAP hbm, _In_ UINT start, _In_ UINT cLines, _Out_opt_ LPVOID lpvBits, _At_((LPBITMAPINFOHEADER) lpbmi, _Inout_) LPBITMAPINFO lpbmi, _In_ UINT usage)
UINT WINAPI SetTextAlign(_In_ HDC, _In_ UINT)
Definition: text.c:883
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
#define TA_RIGHT
Definition: wingdi.h:933
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
#define TA_LEFT
Definition: wingdi.h:932
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define DEFAULT_CHARSET
Definition: wingdi.h:384
#define TRANSPARENT
Definition: wingdi.h:950
#define WHITE_BRUSH
Definition: wingdi.h:902
#define MWT_IDENTITY
Definition: wingdi.h:944
#define TA_TOP
Definition: wingdi.h:930
#define TA_BOTTOM
Definition: wingdi.h:929
BOOL WINAPI TextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_reads_(c) LPCWSTR lpString, _In_ int c)
#define TA_BASELINE
Definition: wingdi.h:928
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
BOOL WINAPI SetWorldTransform(_In_ HDC, _In_ const XFORM *)
#define TA_CENTER
Definition: wingdi.h:931
BOOL WINAPI DeleteDC(_In_ HDC)
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
#define PS_SOLID
Definition: wingdi.h:586
BOOL WINAPI ModifyWorldTransform(_In_ HDC, _In_opt_ const XFORM *, _In_ DWORD)
#define DT_CENTER
Definition: winuser.h:527
#define DT_SINGLELINE
Definition: winuser.h:540
#define DT_VCENTER
Definition: winuser.h:543
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193