ReactOS  0.4.15-dev-5496-g599ba9c
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 
12 typedef struct tagBITMAPINFOEX
13 {
17 
18 #ifdef DEBUGGING
19 static BOOL SaveBitmapToFile(LPCWSTR pszFileName, HBITMAP hbm)
20 {
21  BOOL f;
23  BITMAPINFOEX bmi;
24  BITMAPINFOHEADER *pbmih;
25  DWORD cb, cbColors;
26  HDC hDC;
27  HANDLE hFile;
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  }
82  DeleteDC(hDC);
83  }
84  HeapFree(GetProcessHeap(), 0, pBits);
85  return f;
86 }
87 #endif
88 
89 typedef 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
100 } TEST_ENTRY;
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 
112 static const RECT s_rc = {0, 0, WIDTH, HEIGHT};
113 static HBRUSH s_hWhiteBrush = NULL;
114 static HPEN s_hRedPen = NULL;
115 
116 static 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");
320  hFont = CreateFontIndirectA(&lf);
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);
347  LineTo(hDC, WIDTH, YCENTER);
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));
410  DrawTextW(hDC, sz, -1, &rc, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
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 
432 START_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;
451  bmi.bmiHeader.biHeight = HEIGHT;
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 
462  DeleteObject(hbm);
463 
466 
467  DeleteDC(hDC);
468 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
#define CloseHandle
Definition: compat.h:739
static HPEN s_hRedPen
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1476
static void DoTestEntry(const TEST_ENTRY *entry, HDC hDC, HBITMAP hbm)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define RGB(r, g, b)
Definition: precomp.h:62
static const TEST_ENTRY s_entries[]
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
#define TRUE
Definition: types.h:120
#define pt(x, y)
Definition: drawing.c:79
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
BITMAPINFOHEADER bmiHeader
Definition: TextTransform.c:14
static HDC
Definition: imagelist.c:92
#define HEIGHT
#define YCENTER
POINT ptRef
Definition: TextTransform.c:95
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define ZeroMemory
Definition: winbase.h:1670
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
#define WHITE_BRUSH
Definition: wingdi.h:902
BYTE lfCharSet
Definition: dimm.idl:50
static HBRUSH s_hWhiteBrush
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define TA_LEFT
Definition: wingdi.h:932
#define LFHEIGHT
BOOL xform_ok
Definition: TextTransform.c:98
UINT WINAPI SetTextAlign(_In_ HDC, _In_ UINT)
Definition: text.c:883
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
Definition: blt.cpp:2
#define DEFAULT_CHARSET
Definition: wingdi.h:384
#define lstrlenW
Definition: compat.h:750
int32_t INT
Definition: typedefs.h:58
LONG lfEscapement
Definition: TextTransform.c:93
HFONT hFont
Definition: main.c:53
const GLfloat * m
Definition: glext.h:10848
#define FILE_SHARE_READ
Definition: compat.h:136
BOOL WINAPI SetWorldTransform(_In_ HDC, _In_ const XFORM *)
#define POS(ix, iy)
static const RECT s_rc
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
#define PS_SOLID
Definition: wingdi.h:586
#define TA_TOP
Definition: wingdi.h:930
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
LONG lfHeight
Definition: dimm.idl:42
#define TA_BASELINE
Definition: wingdi.h:928
#define GENERIC_WRITE
Definition: nt_native.h:90
DWORD biCompression
Definition: amvideo.idl:35
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:41
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
#define TRANSPARENT
Definition: wingdi.h:950
#define TA_BOTTOM
Definition: wingdi.h:929
#define XCENTER
XFORM xform
Definition: TextTransform.c:97
#define DT_VCENTER
Definition: winuser.h:543
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
INT TextAlign
Definition: TextTransform.c:96
#define TA_RIGHT
Definition: wingdi.h:933
#define FILE_FLAG_WRITE_THROUGH
Definition: disk.h:47
GLfloat f
Definition: glext.h:7540
BYTE aBlacks[16]
Definition: TextTransform.c:99
struct tagBITMAPINFOEX BITMAPINFOEX
#define printf
Definition: freeldr.h:94
#define GetProcessHeap()
Definition: compat.h:736
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
ULONG RGBQUAD
Definition: precomp.h:50
RGBQUAD bmiColors[1]
Definition: wingdi.h:1477
__wchar_t WCHAR
Definition: xmlstorage.h:180
DWORD COLORREF
Definition: windef.h:300
BOOL WINAPI ModifyWorldTransform(_In_ HDC, _In_opt_ const XFORM *, _In_ DWORD)
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h:34
INT line
Definition: cmd.c:14
unsigned long DWORD
Definition: ntddk_ex.h:95
#define TA_NOUPDATECP
Definition: wingdi.h:935
DWORD biSizeImage
Definition: amvideo.idl:36
LONG lfWidth
Definition: dimm.idl:43
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
#define GM_COMPATIBLE
Definition: wingdi.h:864
struct TEST_ENTRY TEST_ENTRY
int ret
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
RGBQUAD bmiColors[256]
Definition: TextTransform.c:15
#define LFWIDTH1
Definition: cmd.c:12
uint32_t entry
Definition: isohybrid.c:63
START_TEST(TextTransform)
struct tagBITMAPINFOEX * LPBITMAPINFOEX
_In_ HANDLE hFile
Definition: mswsock.h:90
BOOL WINAPI TextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_reads_(c) LPCWSTR lpString, _In_ int c)
unsigned char BYTE
Definition: xxhash.c:193
#define WIDTH
LONG lfWidth
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
static HDC hDC
Definition: 3dtext.c:33
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
#define DT_SINGLELINE
Definition: winuser.h:540
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define CREATE_ALWAYS
Definition: disk.h:72
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
_In_ ULONG _In_ ULONG rgb
Definition: winddi.h:3520
BOOL WINAPI DeleteDC(_In_ HDC)
BOOL WINAPI Ellipse(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
#define f
Definition: ke_i.h:83
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
Definition: bitmap.c:199
struct tagBITMAPFILEHEADER BITMAPFILEHEADER
_In_ HBITMAP hbm
Definition: ntgdi.h:2776
#define ok(value,...)
Definition: atltest.h:57
Definition: bl.h:1330
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define CreateFileW
Definition: compat.h:741
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define MWT_IDENTITY
Definition: wingdi.h:944
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
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)
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
#define DT_CENTER
Definition: winuser.h:527
INT GraphicsMode
Definition: TextTransform.c:94
static HBITMAP
Definition: button.c:44
#define TA_CENTER
Definition: wingdi.h:931
#define FAR
Definition: zlib.h:34
#define DIB_RGB_COLORS
Definition: wingdi.h:367
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
int WINAPI SetGraphicsMode(_In_ HDC, _In_ int)
Definition: dc.c:1226
#define BI_RGB
Definition: precomp.h:47
int k
Definition: mpi.c:3369
#define HeapFree(x, y, z)
Definition: compat.h:735
LONG lfEscapement
Definition: dimm.idl:44
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:17
#define LFESCAPE1
#define GM_ADVANCED
Definition: wingdi.h:865