ReactOS  0.4.15-dev-1049-g1062a29
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_(), DoEntry(), 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:111
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLuint GLuint GLsizei count
Definition: gl.h:1545
int32_t INT
Definition: typedefs.h:58
& 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:484
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:110
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:483

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:1071

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 1071 of file text.c.

1077 {
1078  SIZE size;
1079  const WCHAR *strPtr;
1080  WCHAR *retstr, *p_retstr;
1081  size_t size_retstr;
1083  int len, lh, count=i_count;
1084  TEXTMETRICW tm;
1085  int lmargin = 0, rmargin = 0;
1086  int x = rect->left, y = rect->top;
1087  int width = rect->right - rect->left;
1088  int max_width = 0;
1089  int last_line;
1090  int tabwidth /* to keep gcc happy */ = 0;
1091  int prefix_offset;
1092  ellipsis_data ellip;
1093  BOOL invert_y=FALSE;
1094 
1095  HRGN hrgn = 0;
1096 
1097 #ifdef _WIN32K_
1098  TRACE("%S, %d, %08x\n", str, count, flags);
1099 #else
1100  TRACE("%s, %d, [%s] %08x\n", debugstr_wn (str, count), count,
1102 #endif
1103  if (dtp) TRACE("Params: iTabLength=%d, iLeftMargin=%d, iRightMargin=%d\n",
1104  dtp->iTabLength, dtp->iLeftMargin, dtp->iRightMargin);
1105 
1106  if (!str) return 0;
1107 
1108  strPtr = str;
1109 
1110  if (flags & DT_SINGLELINE)
1111  flags &= ~DT_WORDBREAK;
1112 #ifdef _WIN32K_
1114 #else
1115  GetTextMetricsW(hdc, &tm);
1116 #endif
1117  if (flags & DT_EXTERNALLEADING)
1118  lh = tm.tmHeight + tm.tmExternalLeading;
1119  else
1120  lh = tm.tmHeight;
1121 
1122  if (str[0] && count == 0)
1123  return lh;
1124 
1125  if (dtp && dtp->cbSize != sizeof(DRAWTEXTPARAMS))
1126  return 0;
1127 #ifdef _WIN32K_
1129  {
1130  SIZE window_ext, viewport_ext;
1131  GreGetWindowExtEx(hdc, &window_ext);
1132  GreGetViewportExtEx(hdc, &viewport_ext);
1133  if ((window_ext.cy > 0) != (viewport_ext.cy > 0))
1134  invert_y = TRUE;
1135  }
1136 #else
1138  {
1139  SIZE window_ext, viewport_ext;
1140  GetWindowExtEx(hdc, &window_ext);
1141  GetViewportExtEx(hdc, &viewport_ext);
1142  if ((window_ext.cy > 0) != (viewport_ext.cy > 0))
1143  invert_y = TRUE;
1144  }
1145 #endif
1146  if (count == -1)
1147  {
1148 #ifdef _WIN32K_
1149  count = wcslen(str);
1150 #else
1151  count = strlenW(str);
1152 #endif
1153  if (count == 0)
1154  {
1155  if( flags & DT_CALCRECT)
1156  {
1157  rect->right = rect->left;
1158  if( flags & DT_SINGLELINE)
1159  rect->bottom = rect->top + (invert_y ? -lh : lh);
1160  else
1161  rect->bottom = rect->top;
1162  }
1163  return lh;
1164  }
1165  }
1166 
1167  if (dtp)
1168  {
1169  lmargin = dtp->iLeftMargin;
1170  rmargin = dtp->iRightMargin;
1171  if (!(flags & (DT_CENTER | DT_RIGHT)))
1172  x += lmargin;
1173  dtp->uiLengthDrawn = 0; /* This param RECEIVES number of chars processed */
1174  }
1175 
1176  if (flags & DT_EXPANDTABS)
1177  {
1178  int tabstop = ((flags & DT_TABSTOP) && dtp && dtp->iTabLength) ? dtp->iTabLength : 8;
1179  tabwidth = tm.tmAveCharWidth * tabstop;
1180  }
1181 
1182  if (flags & DT_CALCRECT) flags |= DT_NOCLIP;
1183 #ifndef _WIN32K_
1184  if (!(flags & DT_NOCLIP) )
1185  {
1186  int hasClip;
1187  hrgn = CreateRectRgn(0,0,0,0);
1188  if (hrgn)
1189  {
1190  hasClip = GetClipRgn(hdc, hrgn);
1191  // If the region to be retrieved is NULL, the return value is 0.
1192  if (hasClip != 1)
1193  {
1194  DeleteObject(hrgn);
1195  hrgn = NULL;
1196  }
1197  IntersectClipRect(hdc, rect->left, rect->top, rect->right, rect->bottom);
1198  }
1199  }
1200 #else
1201  if (!(flags & DT_NOCLIP) )
1202  {
1203  int hasClip;
1204  hrgn = NtGdiCreateRectRgn(0,0,0,0);
1205  if (hrgn)
1206  {
1207  hasClip = NtGdiGetRandomRgn(hdc, hrgn, CLIPRGN);
1208  if (hasClip != 1)
1209  {
1211  hrgn = NULL;
1212  }
1213  NtGdiIntersectClipRect(hdc, rect->left, rect->top, rect->right, rect->bottom);
1214  }
1215  }
1216 #endif
1217  if (flags & DT_MODIFYSTRING)
1218  {
1219  size_retstr = (count + 4) * sizeof (WCHAR);
1220 #ifdef _WIN32K_
1221  retstr = ExAllocatePoolWithTag(PagedPool, size_retstr, USERTAG_RTL);
1222 #else
1223  retstr = HeapAlloc(GetProcessHeap(), 0, size_retstr);
1224 #endif
1225  if (!retstr) return 0;
1226  memcpy (retstr, str, size_retstr);
1227  }
1228  else
1229  {
1230  size_retstr = 0;
1231  retstr = NULL;
1232  }
1233  p_retstr = retstr;
1234 
1235  do
1236  {
1237  len = sizeof(line)/sizeof(line[0]);
1238  if (invert_y)
1239  last_line = !(flags & DT_NOCLIP) && y - ((flags & DT_EDITCONTROL) ? 2*lh-1 : lh) < rect->bottom;
1240  else
1241  last_line = !(flags & DT_NOCLIP) && y + ((flags & DT_EDITCONTROL) ? 2*lh-1 : lh) > rect->bottom;
1242  strPtr = TEXT_NextLineW(hdc, strPtr, &count, line, &len, width, flags, &size, last_line, &p_retstr, tabwidth, &prefix_offset, &ellip);
1243 
1244 #ifdef __REACTOS__
1245  if (flags & DT_CENTER)
1246  {
1247  if (((rect->right - rect->left) < size.cx) && (flags & DT_CALCRECT))
1248  {
1249  x = rect->left + size.cx;
1250  }
1251  else
1252  {
1253  x = (rect->left + rect->right - size.cx) / 2;
1254  }
1255  }
1256 #else
1257  if (flags & DT_CENTER) x = (rect->left + rect->right -
1258  size.cx) / 2;
1259 #endif
1260  else if (flags & DT_RIGHT) x = rect->right - size.cx;
1261 
1262  if (flags & DT_SINGLELINE)
1263  {
1264 #ifdef __REACTOS__
1265  if (flags & DT_VCENTER) y = rect->top +
1266  (rect->bottom - rect->top + (invert_y ? size.cy : -size.cy)) / 2;
1267  else if (flags & DT_BOTTOM)
1268  y = rect->bottom + (invert_y ? size.cy : -size.cy);
1269 #else
1270  if (flags & DT_VCENTER) y = rect->top +
1271  (rect->bottom - rect->top) / 2 - size.cy / 2;
1272  else if (flags & DT_BOTTOM) y = rect->bottom - size.cy;
1273 #endif
1274  }
1275 
1276  if (!(flags & DT_CALCRECT))
1277  {
1278  const WCHAR *str = line;
1279  int xseg = x;
1280  while (len)
1281  {
1282  int len_seg;
1283  SIZE size;
1284  if ((flags & DT_EXPANDTABS))
1285  {
1286  const WCHAR *p;
1287  p = str; while (p < str+len && *p != TAB) p++;
1288  len_seg = p - str;
1289  if (len_seg != len &&
1290 #ifdef _WIN32K_
1291  !GreGetTextExtentW(hdc, str, len_seg, &size, 0))
1292 #else
1293  !GetTextExtentPointW(hdc, str, len_seg, &size))
1294 #endif
1295  {
1296 #ifdef _WIN32K_
1297  ExFreePoolWithTag(retstr, USERTAG_RTL);
1298 #else
1299  HeapFree (GetProcessHeap(), 0, retstr);
1300 #endif
1301  return 0;
1302  }
1303  }
1304  else
1305  len_seg = len;
1306 #ifdef _WIN32K_
1307  if (!UserExtTextOutW( hdc, xseg, y,
1308  ((flags & DT_NOCLIP) ? 0 : ETO_CLIPPED) |
1309  ((flags & DT_RTLREADING) ? ETO_RTLREADING : 0),
1310  rect, str, len_seg))
1311 #else
1312  if (!ExtTextOutW( hdc, xseg, y,
1313  ((flags & DT_NOCLIP) ? 0 : ETO_CLIPPED) |
1314  ((flags & DT_RTLREADING) ? ETO_RTLREADING : 0),
1315  rect, str, len_seg, NULL ))
1316 #endif
1317  {
1318 #ifdef _WIN32K_
1319  ExFreePoolWithTag(retstr, USERTAG_RTL);
1320 #else
1321  HeapFree (GetProcessHeap(), 0, retstr);
1322 #endif
1323  return 0;
1324  }
1325  if (prefix_offset != -1 && prefix_offset < len_seg)
1326  {
1327  TEXT_DrawUnderscore (hdc, xseg, y + tm.tmAscent + 1, str, prefix_offset, (flags & DT_NOCLIP) ? NULL : rect);
1328  }
1329  len -= len_seg;
1330  str += len_seg;
1331  if (len)
1332  {
1333  assert ((flags & DT_EXPANDTABS) && *str == TAB);
1334  len--; str++;
1335  xseg += ((size.cx/tabwidth)+1)*tabwidth;
1336  if (prefix_offset != -1)
1337  {
1338  if (prefix_offset < len_seg)
1339  {
1340  /* We have just drawn an underscore; we ought to
1341  * figure out where the next one is. I am going
1342  * to leave it for now until I have a better model
1343  * for the line, which will make reprefixing easier.
1344  * This is where ellip would be used.
1345  */
1346  prefix_offset = -1;
1347  }
1348  else
1349  prefix_offset -= len_seg;
1350  }
1351  }
1352  }
1353  }
1354  else if (size.cx > max_width)
1355  max_width = size.cx;
1356 
1357  y += invert_y ? -lh : lh;
1358  if (dtp)
1359  dtp->uiLengthDrawn += len;
1360  }
1361  while (strPtr && !last_line);
1362 
1363 #ifndef _WIN32K_
1364  if (!(flags & DT_NOCLIP) )
1365  {
1366  SelectClipRgn(hdc, hrgn); // This should be NtGdiExtSelectClipRgn, but due to ReactOS build rules this option is next:
1367  GdiFlush(); // Flush the batch and level up! See CORE-16498.
1368  if (hrgn)
1369  {
1370  DeleteObject(hrgn);
1371  }
1372  }
1373 #else
1374  if (!(flags & DT_NOCLIP) )
1375  {
1377  if (hrgn)
1378  {
1380  }
1381  }
1382 #endif
1383 
1384  if (flags & DT_CALCRECT)
1385  {
1386  rect->right = rect->left + max_width;
1387  rect->bottom = y;
1388  if (dtp)
1389  rect->right += lmargin + rmargin;
1390  }
1391  if (retstr)
1392  {
1393  memcpy (str, retstr, size_retstr);
1394 #ifdef _WIN32K_
1395  ExFreePoolWithTag(retstr, USERTAG_RTL);
1396 #else
1397  HeapFree (GetProcessHeap(), 0, retstr);
1398 #endif
1399  }
1400  return y - rect->top;
1401 }
__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
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:486
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)
#define TRUE
Definition: types.h:120
__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:78
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 FALSE
Definition: types.h:117
#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:484
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:193
__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:3075
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
BOOL WINAPI GdiFlush(void)
Definition: misc.c:44
#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:3076
#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:335
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:483
#define MAX_BUFFER
Definition: text.c:1065
#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:484
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:110
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:483

◆ 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 }
#define FALSE
Definition: types.h:117
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:484
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:110
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:483

◆ 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 Y(I)
#define TRUE
Definition: types.h:120
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:58
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:249
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:1499
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:484
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:483
BOOL WINAPI GetTextExtentPointW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE lpsz)

Referenced by DrawTest().