ReactOS  0.4.14-dev-77-gd9e7c48
font.c File Reference
#include <user32.h>
Include dependency graph for font.c:

Go to the source code of this file.

Macros

#define MAX_BUFFER   1024
 
#define PREFIX   38
 
#define ALPHA_PREFIX   30 /* Win16: Alphabet prefix */
 
#define KANA_PREFIX   31 /* Win16: Katakana prefix */
 

Functions

DWORD WINAPI GdiGetCodePage (HDC hdc)
 
INT WINAPI DrawTextExWorker (HDC hdc, LPWSTR str, INT i_count, LPRECT rect, UINT flags, LPDRAWTEXTPARAMS dtp)
 
LONG TEXT_TabbedTextOut (HDC hdc, INT x, INT y, LPCWSTR lpstr, INT count, INT cTabStops, const INT *lpTabPos, INT nTabOrg, BOOL fDisplayText)
 
LONG WINAPI TabbedTextOutA (HDC hDC, int X, int Y, LPCSTR lpString, int nCount, int nTabPositions, CONST INT *lpnTabStopPositions, int nTabOrigin)
 
LONG WINAPI TabbedTextOutW (HDC hDC, int X, int Y, LPCWSTR lpString, int nCount, int nTabPositions, CONST INT *lpnTabStopPositions, int nTabOrigin)
 
DWORD WINAPI GetTabbedTextExtentA (HDC hDC, LPCSTR lpString, int nCount, int nTabPositions, CONST INT *lpnTabStopPositions)
 
DWORD WINAPI GetTabbedTextExtentW (HDC hDC, LPCWSTR lpString, int nCount, int nTabPositions, CONST INT *lpnTabStopPositions)
 
INT WINAPI DrawTextExW (HDC hdc, LPWSTR str, INT i_count, LPRECT rect, UINT flags, LPDRAWTEXTPARAMS dtp)
 
INT WINAPI DrawTextExA (HDC hdc, LPSTR str, INT count, LPRECT rect, UINT flags, LPDRAWTEXTPARAMS dtp)
 
INT WINAPI DrawTextW (HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
 
INT WINAPI DrawTextA (HDC hdc, LPCSTR str, INT count, LPRECT rect, UINT flags)
 
INT WINAPI UserLpkPSMTextOut (HDC hdc, int x, int y, LPCWSTR lpString, int cString, DWORD dwFlags)
 

Macro Definition Documentation

◆ ALPHA_PREFIX

#define ALPHA_PREFIX   30 /* Win16: Alphabet prefix */

Definition at line 410 of file font.c.

◆ KANA_PREFIX

#define KANA_PREFIX   31 /* Win16: Katakana prefix */

Definition at line 411 of file font.c.

◆ MAX_BUFFER

#define MAX_BUFFER   1024

Definition at line 253 of file font.c.

◆ PREFIX

#define PREFIX   38

Definition at line 409 of file font.c.

Function Documentation

◆ DrawTextA()

INT WINAPI DrawTextA ( HDC  hdc,
LPCSTR  str,
INT  count,
LPRECT  rect,
UINT  flags 
)

Definition at line 373 of file font.c.

374 {
375  DRAWTEXTPARAMS dtp;
376 
377  memset (&dtp, 0, sizeof(dtp));
378  dtp.cbSize = sizeof(dtp);
379  if (flags & DT_TABSTOP)
380  {
381  dtp.iTabLength = (flags >> 8) & 0xff;
382  flags &= 0xffff00ff;
383  }
384  return DrawTextExA( hdc, (LPSTR)str, count, rect, flags, &dtp );
385 }
#define DT_TABSTOP
Definition: winuser.h:541
GLuint GLuint GLsizei count
Definition: gl.h:1545
char * LPSTR
Definition: xmlstorage.h:182
& rect
Definition: startmenu.cpp:1413
const WCHAR * str
GLbitfield flags
Definition: glext.h:7161
HDC hdc
Definition: main.c:9
INT WINAPI DrawTextExA(HDC hdc, LPSTR str, INT count, LPRECT rect, UINT flags, LPDRAWTEXTPARAMS dtp)
Definition: font.c:276
#define memset(x, y, z)
Definition: compat.h:39

Referenced by create_bitmap(), DECLARE_INTERFACE_(), menu_ownerdraw_wnd_proc(), PAINTING_DrawStateJam(), test_bcm_get_ideal_size(), and test_DrawTextCalcRect().

◆ DrawTextExA()

INT WINAPI DrawTextExA ( HDC  hdc,
LPSTR  str,
INT  count,
LPRECT  rect,
UINT  flags,
LPDRAWTEXTPARAMS  dtp 
)

Definition at line 276 of file font.c.

278 {
279  WCHAR *wstr;
280  WCHAR *p;
281  INT ret = 0;
282  int i;
283  DWORD wcount;
284  DWORD wmax;
285  DWORD amax;
286  UINT cp;
287 
288  if (!count) return 0;
289  if (!str && count > 0) return 0;
290  if( !str || ((count == -1) && !(count = strlen(str))))
291  {
292  int lh;
293  TEXTMETRICA tm;
294 
295  if (dtp && dtp->cbSize != sizeof(DRAWTEXTPARAMS))
296  return 0;
297 
300  lh = tm.tmHeight + tm.tmExternalLeading;
301  else
302  lh = tm.tmHeight;
303 
304  if( flags & DT_CALCRECT)
305  {
306  rect->right = rect->left;
307  if( flags & DT_SINGLELINE)
308  rect->bottom = rect->top + lh;
309  else
310  rect->bottom = rect->top;
311  }
312  return lh;
313  }
314  cp = GdiGetCodePage( hdc );
315  wcount = MultiByteToWideChar( cp, 0, str, count, NULL, 0 );
316  wmax = wcount;
317  amax = count;
318  if (flags & DT_MODIFYSTRING)
319  {
320  wmax += 4;
321  amax += 4;
322  }
323  wstr = HeapAlloc(GetProcessHeap(), 0, wmax * sizeof(WCHAR));
324  if (wstr)
325  {
326  MultiByteToWideChar( cp, 0, str, count, wstr, wcount );
327  if (flags & DT_MODIFYSTRING)
328  for (i=4, p=wstr+wcount; i--; p++) *p=0xFFFE;
329  /* Initialise the extra characters so that we can see which ones
330  * change. U+FFFE is guaranteed to be not a unicode character and
331  * so will not be generated by DrawTextEx itself.
332  */
333  ret = DrawTextExW( hdc, wstr, wcount, rect, flags, dtp );
334  if (flags & DT_MODIFYSTRING)
335  {
336  /* Unfortunately the returned string may contain multiple \0s
337  * and so we need to measure it ourselves.
338  */
339  for (i=4, p=wstr+wcount; i-- && *p != 0xFFFE; p++) wcount++;
340  WideCharToMultiByte( cp, 0, wstr, wcount, str, amax, NULL, NULL );
341  }
342  HeapFree(GetProcessHeap(), 0, wstr);
343  }
344  return ret;
345 }
#define WideCharToMultiByte
Definition: compat.h:101
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLuint GLuint GLsizei count
Definition: gl.h:1545
int32_t INT
Definition: typedefs.h:56
& rect
Definition: startmenu.cpp:1413
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
#define DT_CALCRECT
Definition: winuser.h:526
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
Definition: text.c:200
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
static UINT UINT count
Definition: font.c:44
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
int ret
HDC hdc
Definition: main.c:9
INT WINAPI DrawTextExW(HDC hdc, LPWSTR str, INT i_count, LPRECT rect, UINT flags, LPDRAWTEXTPARAMS dtp)
Definition: font.c:259
Definition: time.h:76
#define DT_SINGLELINE
Definition: winuser.h:540
#define DT_EXTERNALLEADING
Definition: winuser.h:533
unsigned int UINT
Definition: ndis.h:50
#define MultiByteToWideChar
Definition: compat.h:100
POINT cp
Definition: magnifier.c:59
#define DT_MODIFYSTRING
Definition: winuser.h:535
GLfloat GLfloat p
Definition: glext.h:8902
DWORD WINAPI GdiGetCodePage(HDC hdc)
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by DrawTextA().

◆ DrawTextExW()

INT WINAPI DrawTextExW ( HDC  hdc,
LPWSTR  str,
INT  i_count,
LPRECT  rect,
UINT  flags,
LPDRAWTEXTPARAMS  dtp 
)

Definition at line 259 of file font.c.

261 {
262  return DrawTextExWorker( hdc, str, i_count, rect, flags, dtp );
263 }
& rect
Definition: startmenu.cpp:1413
const WCHAR * str
GLbitfield flags
Definition: glext.h:7161
HDC hdc
Definition: main.c:9
INT WINAPI DrawTextExWorker(HDC hdc, LPWSTR str, INT i_count, LPRECT rect, UINT flags, LPDRAWTEXTPARAMS dtp)
Definition: text.c:1072

Referenced by DrawTextExA(), and DrawTextW().

◆ DrawTextExWorker()

INT WINAPI DrawTextExWorker ( HDC  hdc,
LPWSTR  str,
INT  i_count,
LPRECT  rect,
UINT  flags,
LPDRAWTEXTPARAMS  dtp 
)

Definition at line 1072 of file text.c.

1078 {
1079  SIZE size;
1080  const WCHAR *strPtr;
1081  WCHAR *retstr, *p_retstr;
1082  size_t size_retstr;
1084  int len, lh, count=i_count;
1085  TEXTMETRICW tm;
1086  int lmargin = 0, rmargin = 0;
1087  int x = rect->left, y = rect->top;
1088  int width = rect->right - rect->left;
1089  int max_width = 0;
1090  int last_line;
1091  int tabwidth /* to keep gcc happy */ = 0;
1092  int prefix_offset;
1093  ellipsis_data ellip;
1094  BOOL invert_y=FALSE;
1095 
1096  HRGN hrgn = 0;
1097 
1098 #ifdef _WIN32K_
1099  TRACE("%S, %d, %08x\n", str, count, flags);
1100 #else
1101  TRACE("%s, %d, [%s] %08x\n", debugstr_wn (str, count), count,
1103 #endif
1104  if (dtp) TRACE("Params: iTabLength=%d, iLeftMargin=%d, iRightMargin=%d\n",
1105  dtp->iTabLength, dtp->iLeftMargin, dtp->iRightMargin);
1106 
1107  if (!str) return 0;
1108 
1109  strPtr = str;
1110 
1111  if (flags & DT_SINGLELINE)
1112  flags &= ~DT_WORDBREAK;
1113 #ifdef _WIN32K_
1115 #else
1116  GetTextMetricsW(hdc, &tm);
1117 #endif
1118  if (flags & DT_EXTERNALLEADING)
1119  lh = tm.tmHeight + tm.tmExternalLeading;
1120  else
1121  lh = tm.tmHeight;
1122 
1123  if (str[0] && count == 0)
1124  return lh;
1125 
1126  if (dtp && dtp->cbSize != sizeof(DRAWTEXTPARAMS))
1127  return 0;
1128 #ifdef _WIN32K_
1130  {
1131  SIZE window_ext, viewport_ext;
1132  GreGetWindowExtEx(hdc, &window_ext);
1133  GreGetViewportExtEx(hdc, &viewport_ext);
1134  if ((window_ext.cy > 0) != (viewport_ext.cy > 0))
1135  invert_y = TRUE;
1136  }
1137 #else
1139  {
1140  SIZE window_ext, viewport_ext;
1141  GetWindowExtEx(hdc, &window_ext);
1142  GetViewportExtEx(hdc, &viewport_ext);
1143  if ((window_ext.cy > 0) != (viewport_ext.cy > 0))
1144  invert_y = TRUE;
1145  }
1146 #endif
1147  if (count == -1)
1148  {
1149 #ifdef _WIN32K_
1150  count = wcslen(str);
1151 #else
1152  count = strlenW(str);
1153 #endif
1154  if (count == 0)
1155  {
1156  if( flags & DT_CALCRECT)
1157  {
1158  rect->right = rect->left;
1159  if( flags & DT_SINGLELINE)
1160  rect->bottom = rect->top + (invert_y ? -lh : lh);
1161  else
1162  rect->bottom = rect->top;
1163  }
1164  return lh;
1165  }
1166  }
1167 
1168  if (dtp)
1169  {
1170  lmargin = dtp->iLeftMargin;
1171  rmargin = dtp->iRightMargin;
1172  if (!(flags & (DT_CENTER | DT_RIGHT)))
1173  x += lmargin;
1174  dtp->uiLengthDrawn = 0; /* This param RECEIVES number of chars processed */
1175  }
1176 
1177  if (flags & DT_EXPANDTABS)
1178  {
1179  int tabstop = ((flags & DT_TABSTOP) && dtp && dtp->iTabLength) ? dtp->iTabLength : 8;
1180  tabwidth = tm.tmAveCharWidth * tabstop;
1181  }
1182 
1183  if (flags & DT_CALCRECT) flags |= DT_NOCLIP;
1184 #ifndef _WIN32K_
1185  if (!(flags & DT_NOCLIP) )
1186  {
1187  int hasClip;
1188  hrgn = CreateRectRgn(0,0,0,0);
1189  if (hrgn)
1190  {
1191  hasClip = GetClipRgn(hdc, hrgn);
1192  // If the region to be retrieved is NULL, the return value is 0.
1193  if (hasClip != 1)
1194  {
1195  DeleteObject(hrgn);
1196  hrgn = NULL;
1197  }
1198  IntersectClipRect(hdc, rect->left, rect->top, rect->right, rect->bottom);
1199  }
1200  }
1201 #else
1202  if (!(flags & DT_NOCLIP) )
1203  {
1204  int hasClip;
1205  hrgn = NtGdiCreateRectRgn(0,0,0,0);
1206  if (hrgn)
1207  {
1208  hasClip = NtGdiGetRandomRgn(hdc, hrgn, CLIPRGN);
1209  if (hasClip != 1)
1210  {
1212  hrgn = NULL;
1213  }
1214  NtGdiIntersectClipRect(hdc, rect->left, rect->top, rect->right, rect->bottom);
1215  }
1216  }
1217 #endif
1218  if (flags & DT_MODIFYSTRING)
1219  {
1220  size_retstr = (count + 4) * sizeof (WCHAR);
1221 #ifdef _WIN32K_
1222  retstr = ExAllocatePoolWithTag(PagedPool, size_retstr, USERTAG_RTL);
1223 #else
1224  retstr = HeapAlloc(GetProcessHeap(), 0, size_retstr);
1225 #endif
1226  if (!retstr) return 0;
1227  memcpy (retstr, str, size_retstr);
1228  }
1229  else
1230  {
1231  size_retstr = 0;
1232  retstr = NULL;
1233  }
1234  p_retstr = retstr;
1235 
1236  do
1237  {
1238  len = sizeof(line)/sizeof(line[0]);
1239  if (invert_y)
1240  last_line = !(flags & DT_NOCLIP) && y - ((flags & DT_EDITCONTROL) ? 2*lh-1 : lh) < rect->bottom;
1241  else
1242  last_line = !(flags & DT_NOCLIP) && y + ((flags & DT_EDITCONTROL) ? 2*lh-1 : lh) > rect->bottom;
1243  strPtr = TEXT_NextLineW(hdc, strPtr, &count, line, &len, width, flags, &size, last_line, &p_retstr, tabwidth, &prefix_offset, &ellip);
1244 
1245 #ifdef __REACTOS__
1246  if (flags & DT_CENTER)
1247  {
1248  if (((rect->right - rect->left) < size.cx) && (flags & DT_CALCRECT))
1249  {
1250  x = rect->left + size.cx;
1251  }
1252  else
1253  {
1254  x = (rect->left + rect->right - size.cx) / 2;
1255  }
1256  }
1257 #else
1258  if (flags & DT_CENTER) x = (rect->left + rect->right -
1259  size.cx) / 2;
1260 #endif
1261  else if (flags & DT_RIGHT) x = rect->right - size.cx;
1262 
1263  if (flags & DT_SINGLELINE)
1264  {
1265 #ifdef __REACTOS__
1266  if (flags & DT_VCENTER)
1267  {
1268  if (flags & DT_CALCRECT)
1269  {
1270  if (rect->bottom - rect->top < size.cy / 2)
1271  y = rect->top + (invert_y ? size.cy : -size.cy) / 2;
1272  }
1273  else
1274  {
1275  y = rect->top + (rect->bottom - rect->top + (invert_y ? size.cy : -size.cy)) / 2;
1276  }
1277  }
1278  else if (flags & DT_BOTTOM)
1279  y = rect->bottom + (invert_y ? 0 : -size.cy);
1280 #else
1281  if (flags & DT_VCENTER) y = rect->top +
1282  (rect->bottom - rect->top) / 2 - size.cy / 2;
1283  else if (flags & DT_BOTTOM) y = rect->bottom - size.cy;
1284 #endif
1285  }
1286 
1287  if (!(flags & DT_CALCRECT))
1288  {
1289  const WCHAR *str = line;
1290  int xseg = x;
1291  while (len)
1292  {
1293  int len_seg;
1294  SIZE size;
1295  if ((flags & DT_EXPANDTABS))
1296  {
1297  const WCHAR *p;
1298  p = str; while (p < str+len && *p != TAB) p++;
1299  len_seg = p - str;
1300  if (len_seg != len &&
1301 #ifdef _WIN32K_
1302  !GreGetTextExtentW(hdc, str, len_seg, &size, 0))
1303 #else
1304  !GetTextExtentPointW(hdc, str, len_seg, &size))
1305 #endif
1306  {
1307 #ifdef _WIN32K_
1308  ExFreePoolWithTag(retstr, USERTAG_RTL);
1309 #else
1310  HeapFree (GetProcessHeap(), 0, retstr);
1311 #endif
1312  return 0;
1313  }
1314  }
1315  else
1316  len_seg = len;
1317 #ifdef _WIN32K_
1318  if (!UserExtTextOutW( hdc, xseg, y,
1319  ((flags & DT_NOCLIP) ? 0 : ETO_CLIPPED) |
1320  ((flags & DT_RTLREADING) ? ETO_RTLREADING : 0),
1321  rect, str, len_seg))
1322 #else
1323  if (!ExtTextOutW( hdc, xseg, y,
1324  ((flags & DT_NOCLIP) ? 0 : ETO_CLIPPED) |
1325  ((flags & DT_RTLREADING) ? ETO_RTLREADING : 0),
1326  rect, str, len_seg, NULL ))
1327 #endif
1328  {
1329 #ifdef _WIN32K_
1330  ExFreePoolWithTag(retstr, USERTAG_RTL);
1331 #else
1332  HeapFree (GetProcessHeap(), 0, retstr);
1333 #endif
1334  return 0;
1335  }
1336  if (prefix_offset != -1 && prefix_offset < len_seg)
1337  {
1338  TEXT_DrawUnderscore (hdc, xseg, y + tm.tmAscent + 1, str, prefix_offset, (flags & DT_NOCLIP) ? NULL : rect);
1339  }
1340  len -= len_seg;
1341  str += len_seg;
1342  if (len)
1343  {
1344  assert ((flags & DT_EXPANDTABS) && *str == TAB);
1345  len--; str++;
1346  xseg += ((size.cx/tabwidth)+1)*tabwidth;
1347  if (prefix_offset != -1)
1348  {
1349  if (prefix_offset < len_seg)
1350  {
1351  /* We have just drawn an underscore; we ought to
1352  * figure out where the next one is. I am going
1353  * to leave it for now until I have a better model
1354  * for the line, which will make reprefixing easier.
1355  * This is where ellip would be used.
1356  */
1357  prefix_offset = -1;
1358  }
1359  else
1360  prefix_offset -= len_seg;
1361  }
1362  }
1363  }
1364  }
1365  else if (size.cx > max_width)
1366  max_width = size.cx;
1367 
1368  y += invert_y ? -lh : lh;
1369  if (dtp)
1370  dtp->uiLengthDrawn += len;
1371  }
1372  while (strPtr && !last_line);
1373 
1374 #ifndef _WIN32K_
1375  if (!(flags & DT_NOCLIP) )
1376  {
1378  if (hrgn)
1379  {
1380  DeleteObject(hrgn);
1381  }
1382  }
1383 #else
1384  if (!(flags & DT_NOCLIP) )
1385  {
1387  if (hrgn)
1388  {
1390  }
1391  }
1392 #endif
1393 
1394  if (flags & DT_CALCRECT)
1395  {
1396  rect->right = rect->left + max_width;
1397  rect->bottom = y;
1398  if (dtp)
1399  rect->right += lmargin + rmargin;
1400  }
1401  if (retstr)
1402  {
1403  memcpy (str, retstr, size_retstr);
1404 #ifdef _WIN32K_
1405  ExFreePoolWithTag(retstr, USERTAG_RTL);
1406 #else
1407  HeapFree (GetProcessHeap(), 0, retstr);
1408 #endif
1409  }
1410  return y - rect->top;
1411 }
__kernel_entry W32KAPI HRGN APIENTRY NtGdiCreateRectRgn(_In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom)
#define DT_EXPANDTABS
Definition: winuser.h:532
GLint GLint GLsizei width
Definition: gl.h:1546
#define DT_TABSTOP
Definition: winuser.h:541
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
Definition: gdiobj.c:1155
#define TRUE
Definition: types.h:120
static void TEXT_DrawUnderscore(HDC hdc, int x, int y, const WCHAR *str, int offset, const RECT *rect)
Definition: text.c:894
#define DT_RTLREADING
Definition: winuser.h:539
__kernel_entry W32KAPI INT APIENTRY NtGdiIntersectClipRect(_In_ HDC hdc, _In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom)
Definition: cliprgn.c:503
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)
__kernel_entry W32KAPI INT APIENTRY NtGdiExtSelectClipRgn(_In_ HDC hdc, _In_opt_ HRGN hrgn, _In_ INT iMode)
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define DT_WORDBREAK
Definition: winuser.h:544
BOOL FASTCALL GreGetTextExtentW(HDC hDC, LPCWSTR lpwsz, INT cwc, LPSIZE psize, UINT flOpts)
Definition: text.c:36
int WINAPI IntersectClipRect(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI GreGetViewportExtEx(_In_ HDC hdc, _Out_ LPSIZE lpSize)
Definition: coord.c:1413
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define DT_RIGHT
Definition: winuser.h:538
& rect
Definition: startmenu.cpp:1413
#define DT_CALCRECT
Definition: winuser.h:526
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TAB
Definition: text.c:109
BOOL WINAPI ExtTextOutW(_In_ HDC hdc, _In_ INT x, _In_ INT y, _In_ UINT fuOptions, _In_opt_ const RECT *lprc, _In_reads_opt_(cwc) LPCWSTR lpString, _In_ UINT cwc, _In_reads_opt_(cwc) const INT *lpDx)
Definition: text.c:484
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
#define assert(e)
Definition: text.c:47
#define ETO_CLIPPED
Definition: wingdi.h:647
#define DT_VCENTER
Definition: winuser.h:543
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
if(!(yy_init))
Definition: macro.lex.yy.c:714
BOOL WINAPI GetViewportExtEx(_In_ HDC, _Out_ LPSIZE)
Definition: coord.c:351
BOOL WINAPI GreGetTextMetricsW(_In_ HDC hdc, _Out_ LPTEXTMETRICW lptm)
Definition: text.c:151
__wchar_t WCHAR
Definition: xmlstorage.h:180
int WINAPI GetGraphicsMode(_In_ HDC)
BOOL WINAPI GetWindowExtEx(_In_ HDC, _Out_ LPSIZE)
Definition: coord.c:411
const char * wine_dbgstr_rect(const RECT *rect)
#define CLIPRGN
Definition: precomp.h:18
int iRightMargin
Definition: winuser.h:3074
GLbitfield flags
Definition: glext.h:7161
#define GM_COMPATIBLE
Definition: wingdi.h:863
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
BOOL UserExtTextOutW(HDC hdc, INT x, INT y, UINT flags, PRECTL lprc, LPCWSTR lpString, UINT count)
char line[200]
Definition: main.c:97
BOOL WINAPI GetTextMetricsW(_In_ HDC hdc, _Out_ LPTEXTMETRICW lptm)
Definition: text.c:221
HDC hdc
Definition: main.c:9
static HRGN hrgn
Definition: win.c:55
BOOL APIENTRY GetTextExtentPointW(_In_ HDC hdc, _In_reads_(cchString) LPCWSTR lpString, _In_ INT cchString, _Out_ LPSIZE lpsz)
Definition: text.c:268
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
Definition: time.h:76
#define debugstr_wn
Definition: kernel32.h:33
static const WCHAR * TEXT_NextLineW(HDC hdc, const WCHAR *str, int *count, WCHAR *dest, int *len, int width, DWORD format, SIZE *retsize, int last_line, WCHAR **p_retstr, int tabwidth, int *pprefix_offset, ellipsis_data *pellip)
Definition: text.c:666
#define RGN_COPY
Definition: wingdi.h:356
#define DT_NOCLIP
Definition: winuser.h:536
#define DT_SINGLELINE
Definition: winuser.h:540
#define DT_EXTERNALLEADING
Definition: winuser.h:533
BOOL WINAPI GreGetWindowExtEx(_In_ HDC hdc, _Out_ LPSIZE lpSize)
Definition: coord.c:1404
__kernel_entry W32KAPI INT APIENTRY NtGdiGetRandomRgn(_In_ HDC hdc, _In_ HRGN hrgn, _In_ INT iRgn)
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define USERTAG_RTL
Definition: tags.h:269
UINT uiLengthDrawn
Definition: winuser.h:3075
#define DT_CENTER
Definition: winuser.h:527
int WINAPI GetClipRgn(_In_ HDC, _In_ HRGN)
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
GLfloat GLfloat p
Definition: glext.h:8902
#define DT_BOTTOM
Definition: winuser.h:525
LONG cy
Definition: windef.h:320
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:394
#define MAX_BUFFER
Definition: text.c:1066
#define DT_EDITCONTROL
Definition: winuser.h:528
int FASTCALL GreGetGraphicsMode(HDC)
Definition: dcutil.c:306

Referenced by DrawTextExW().

◆ DrawTextW()

INT WINAPI DrawTextW ( HDC  hdc,
LPCWSTR  str,
INT  count,
LPRECT  rect,
UINT  flags 
)

Definition at line 353 of file font.c.

354 {
355  DRAWTEXTPARAMS dtp;
356 
357  memset (&dtp, 0, sizeof(dtp));
358  dtp.cbSize = sizeof(dtp);
359  if (flags & DT_TABSTOP)
360  {
361  dtp.iTabLength = (flags >> 8) & 0xff;
362  flags &= 0xffff00ff;
363  }
364  return DrawTextExW(hdc, (LPWSTR)str, count, rect, flags, &dtp);
365 }
#define DT_TABSTOP
Definition: winuser.h:541
GLuint GLuint GLsizei count
Definition: gl.h:1545
& rect
Definition: startmenu.cpp:1413
const WCHAR * str
GLbitfield flags
Definition: glext.h:7161
HDC hdc
Definition: main.c:9
INT WINAPI DrawTextExW(HDC hdc, LPWSTR str, INT i_count, LPRECT rect, UINT flags, LPDRAWTEXTPARAMS dtp)
Definition: font.c:259
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define memset(x, y, z)
Definition: compat.h:39

Referenced by ID3DXFontImpl_DrawTextW().

◆ GdiGetCodePage()

◆ GetTabbedTextExtentA()

DWORD WINAPI GetTabbedTextExtentA ( HDC  hDC,
LPCSTR  lpString,
int  nCount,
int  nTabPositions,
CONST INT lpnTabStopPositions 
)

Definition at line 205 of file font.c.

211 {
212  LONG ret;
213  UINT cp = GdiGetCodePage( hDC ); // CP_ACP
214  DWORD len;
215  LPWSTR strW;
216 
217  len = MultiByteToWideChar(cp, 0, lpString, nCount, NULL, 0);
218  if (!len) return 0;
219  strW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
220  if (!strW) return 0;
221  MultiByteToWideChar(cp, 0, lpString, nCount, strW, len);
222  ret = GetTabbedTextExtentW(hDC, strW, len, nTabPositions, lpnTabStopPositions);
224  return ret;
225 }
WCHAR strW[12]
Definition: clipboard.c:2029
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI GetTabbedTextExtentW(HDC hDC, LPCWSTR lpString, int nCount, int nTabPositions, CONST INT *lpnTabStopPositions)
Definition: font.c:232
int ret
GLenum GLsizei len
Definition: glext.h:6722
static HDC hDC
Definition: 3dtext.c:33
unsigned int UINT
Definition: ndis.h:50
#define MultiByteToWideChar
Definition: compat.h:100
POINT cp
Definition: magnifier.c:59
WCHAR * LPWSTR
Definition: xmlstorage.h:184
DWORD WINAPI GdiGetCodePage(HDC hdc)
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ GetTabbedTextExtentW()

DWORD WINAPI GetTabbedTextExtentW ( HDC  hDC,
LPCWSTR  lpString,
int  nCount,
int  nTabPositions,
CONST INT lpnTabStopPositions 
)

Definition at line 232 of file font.c.

238 {
239  return TEXT_TabbedTextOut(hDC, 0, 0, lpString, nCount, nTabPositions, lpnTabStopPositions, 0, FALSE);
240 }
static HDC hDC
Definition: 3dtext.c:33
LONG TEXT_TabbedTextOut(HDC hdc, INT x, INT y, LPCWSTR lpstr, INT count, INT cTabStops, const INT *lpTabPos, INT nTabOrg, BOOL fDisplayText)
Definition: font.c:49

Referenced by GetTabbedTextExtentA().

◆ TabbedTextOutA()

LONG WINAPI TabbedTextOutA ( HDC  hDC,
int  X,
int  Y,
LPCSTR  lpString,
int  nCount,
int  nTabPositions,
CONST INT lpnTabStopPositions,
int  nTabOrigin 
)

Definition at line 156 of file font.c.

165 {
166  LONG ret;
167  DWORD len;
168  LPWSTR strW;
169  UINT cp = GdiGetCodePage( hDC ); // CP_ACP
170 
171  len = MultiByteToWideChar(cp, 0, lpString, nCount, NULL, 0);
172  if (!len) return 0;
173  strW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
174  if (!strW) return 0;
175  MultiByteToWideChar(cp, 0, lpString, nCount, strW, len);
176  ret = TabbedTextOutW(hDC, X, Y, strW, len, nTabPositions, lpnTabStopPositions, nTabOrigin);
178  return ret;
179 }
#define Y(I)
LONG WINAPI TabbedTextOutW(HDC hDC, int X, int Y, LPCWSTR lpString, int nCount, int nTabPositions, CONST INT *lpnTabStopPositions, int nTabOrigin)
Definition: font.c:186
WCHAR strW[12]
Definition: clipboard.c:2029
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
static HDC hDC
Definition: 3dtext.c:33
unsigned int UINT
Definition: ndis.h:50
#define MultiByteToWideChar
Definition: compat.h:100
POINT cp
Definition: magnifier.c:59
WCHAR * LPWSTR
Definition: xmlstorage.h:184
DWORD WINAPI GdiGetCodePage(HDC hdc)
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ TabbedTextOutW()

LONG WINAPI TabbedTextOutW ( HDC  hDC,
int  X,
int  Y,
LPCWSTR  lpString,
int  nCount,
int  nTabPositions,
CONST INT lpnTabStopPositions,
int  nTabOrigin 
)

Definition at line 186 of file font.c.

195 {
196  return TEXT_TabbedTextOut(hDC, X, Y, lpString, nCount, nTabPositions, lpnTabStopPositions, nTabOrigin, TRUE);
197 }
#define TRUE
Definition: types.h:120
#define Y(I)
static HDC hDC
Definition: 3dtext.c:33
LONG TEXT_TabbedTextOut(HDC hdc, INT x, INT y, LPCWSTR lpstr, INT count, INT cTabStops, const INT *lpTabPos, INT nTabOrg, BOOL fDisplayText)
Definition: font.c:49

Referenced by TabbedTextOutA().

◆ TEXT_TabbedTextOut()

LONG TEXT_TabbedTextOut ( HDC  hdc,
INT  x,
INT  y,
LPCWSTR  lpstr,
INT  count,
INT  cTabStops,
const INT lpTabPos,
INT  nTabOrg,
BOOL  fDisplayText 
)

Definition at line 49 of file font.c.

58 {
59  INT defWidth;
60  SIZE extent;
61  int i, j;
62  int start = x;
64 
65  if (!lpTabPos)
66  cTabStops=0;
67 
68  GetTextMetricsW( hdc, &tm );
69 
70  if (cTabStops == 1)
71  {
72  defWidth = *lpTabPos;
73  cTabStops = 0;
74  }
75  else
76  {
77  defWidth = 8 * tm.tmAveCharWidth;
78  }
79 
80  while (count > 0)
81  {
82  RECT r;
83  INT x0;
84  x0 = x;
85  r.left = x0;
86  /* chop the string into substrings of 0 or more <tabs>
87  * possibly followed by 1 or more normal characters */
88  for (i = 0; i < count; i++)
89  if (lpstr[i] != '\t') break;
90  for (j = i; j < count; j++)
91  if (lpstr[j] == '\t') break;
92  /* get the extent of the normal character part */
93  GetTextExtentPointW( hdc, lpstr + i, j - i , &extent );
94  /* and if there is a <tab>, calculate its position */
95  if( i) {
96  /* get x coordinate for the drawing of this string */
97  for (; cTabStops > i; lpTabPos++, cTabStops--)
98  {
99  if( nTabOrg + abs( *lpTabPos) > x) {
100  if( lpTabPos[ i - 1] >= 0) {
101  /* a left aligned tab */
102  x = nTabOrg + lpTabPos[ i-1] + extent.cx;
103  break;
104  }
105  else
106  {
107  /* if tab pos is negative then text is right-aligned
108  * to tab stop meaning that the string extends to the
109  * left, so we must subtract the width of the string */
110  if (nTabOrg - lpTabPos[ i - 1] - extent.cx > x)
111  {
112  x = nTabOrg - lpTabPos[ i - 1];
113  x0 = x - extent.cx;
114  break;
115  }
116  }
117  }
118  }
119  /* if we have run out of tab stops and we have a valid default tab
120  * stop width then round x up to that width */
121  if ((cTabStops <= i) && (defWidth > 0)) {
122  x0 = nTabOrg + ((x - nTabOrg) / defWidth + i) * defWidth;
123  x = x0 + extent.cx;
124  } else if ((cTabStops <= i) && (defWidth < 0)) {
125  x = nTabOrg + ((x - nTabOrg + extent.cx) / -defWidth + i)
126  * -defWidth;
127  x0 = x - extent.cx;
128  }
129  } else
130  x += extent.cx;
131 
132  if (fDisplayText)
133  {
134  r.top = y;
135  r.right = x;
136  r.bottom = y + extent.cy;
137 
139  &r, lpstr + i, j - i, NULL );
140  }
141  count -= j;
142  lpstr += j;
143  }
144 
145  if(!extent.cy)
146  extent.cy = tm.tmHeight;
147 
148  return MAKELONG(x - start, extent.cy);
149 }
BOOL WINAPI ExtTextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_ UINT options, _In_opt_ const RECT *lprect, _In_reads_opt_(c) LPCWSTR lpString, _In_ UINT c, _In_reads_opt_(c) const INT *lpDx)
#define abs(i)
Definition: fconv.c:206
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
GLint x0
Definition: linetemp.h:95
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
int32_t INT
Definition: typedefs.h:56
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
#define ETO_OPAQUE
Definition: wingdi.h:646
#define MAKELONG(a, b)
Definition: typedefs.h:248
smooth NULL
Definition: ftsmooth.c:416
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 WINAPI GetBkMode(_In_ HDC)
static UINT UINT count
Definition: font.c:44
#define OPAQUE
Definition: wingdi.h:948
HDC hdc
Definition: main.c:9
Definition: time.h:76
GLuint start
Definition: gl.h:1545
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
static LPCSTR lpstr
Definition: font.c:51
BOOL WINAPI GetTextExtentPointW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE lpsz)

Referenced by GetTabbedTextExtentW(), and TabbedTextOutW().

◆ UserLpkPSMTextOut()

INT WINAPI UserLpkPSMTextOut ( HDC  hdc,
int  x,
int  y,
LPCWSTR  lpString,
int  cString,
DWORD  dwFlags 
)

Definition at line 413 of file font.c.

414 {
415  SIZE size;
416  TEXTMETRICW tm;
417  int len, i = 0, j = 0;
418  int prefix_count = 0, prefix_offset = -1;
419  LPWSTR display_str = NULL;
420  int prefix_x, prefix_end;
421  HPEN hpen;
422  HPEN oldPen;
423 
424  if (!lpString || cString <= 0)
425  return 0;
426 
427  if (dwFlags & DT_NOPREFIX) /* Windows ignores this */
428  {
429  TextOutW(hdc, x, y, lpString, cString);
430  GetTextExtentPointW(hdc, lpString, cString, &size);
431  return size.cx;
432  }
433 
434  display_str = HeapAlloc(GetProcessHeap(), 0, (cString + 1) * sizeof(WCHAR));
435 
436  if (!display_str)
437  return 0;
438 
439  while (i < cString)
440  {
441  if (lpString[i] == PREFIX || (iswspace(lpString[i]) && lpString[i] != L' '))
442  {
443  if (i < cString - 1 && lpString[i + 1] == PREFIX)
444  display_str[j++] = lpString[i++];
445  else
446  i++;
447  }
448  else
449  {
450  display_str[j++] = lpString[i++];
451  }
452  }
453 
454  display_str[j] = L'\0';
455  len = wcslen(display_str);
456 
457  if (!(dwFlags & DT_PREFIXONLY))
458  TextOutW(hdc, x, y, display_str, len);
459 
460  if (!(dwFlags & DT_HIDEPREFIX))
461  {
462 
463  for (i = 0; i < cString - 1; i++)
464  {
465  if (lpString[i] == PREFIX && lpString[i + 1] != PREFIX)
466  {
467  prefix_offset = i - prefix_count;
468  prefix_count++;
469  }
470  else if (lpString[i] == PREFIX && lpString[i + 1] == PREFIX)
471  {
472  i++;
473  }
474  }
475 
477 
478  if (prefix_offset != -1)
479  {
480  GetTextExtentPointW(hdc, display_str, prefix_offset, &size);
481  prefix_x = x + size.cx;
482  GetTextExtentPointW(hdc, display_str, prefix_offset + 1, &size);
483  prefix_end = x + size.cx - 1;
485  oldPen = SelectObject(hdc, hpen);
486  MoveToEx(hdc, prefix_x, y + tm.tmAscent + 1, NULL);
487  LineTo(hdc, prefix_end, y + tm.tmAscent + 1);
488  SelectObject(hdc, oldPen);
490  }
491  }
492 
493  GetTextExtentPointW(hdc, display_str, len + 1, &size);
494  HeapFree(GetProcessHeap(), 0, display_str);
495 
496  return size.cx;
497 }
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
#define DT_HIDEPREFIX
Definition: winuser.h:547
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
#define PREFIX
Definition: font.c:409
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static HPEN hpen
#define DT_NOPREFIX
Definition: winuser.h:537
#define DT_PREFIXONLY
Definition: winuser.h:548
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
#define PS_SOLID
Definition: wingdi.h:585
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
COLORREF WINAPI GetTextColor(_In_ HDC)
Definition: text.c:831
smooth NULL
Definition: ftsmooth.c:416
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
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define iswspace(_c)
Definition: ctype.h:669
static const WCHAR L[]
Definition: oid.c:1250
HDC hdc
Definition: main.c:9
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
GLenum GLsizei len
Definition: glext.h:6722
Definition: time.h:76
BOOL WINAPI TextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_reads_(c) LPCWSTR lpString, _In_ int c)
static const WORD INT INT LPINT LPINT LPSIZE size
Definition: font.c:53
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
WCHAR * LPWSTR
Definition: xmlstorage.h:184
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:394
BOOL WINAPI GetTextExtentPointW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE lpsz)

Referenced by DrawTest().