2 * PostScript driver text functions
4 * Copyright 1998 Huw D M Davies
12 DEFAULT_DEBUG_CHANNEL(psdrv)
14 /***********************************************************************
17 BOOL PSDRV_ExtTextOut( DC *dc, INT x, INT y, UINT flags,
18 const RECT *lprect, LPCSTR str, UINT count,
21 PSDRV_PDEVICE *physDev = (PSDRV_PDEVICE *)dc->physDev;
25 TRACE(psdrv, "(x=%d, y=%d, flags=0x%08x, str='%.*s', count=%d)\n", x, y,
26 flags, (int)count, str, count);
28 strbuf = (char *)HeapAlloc( PSDRV_Heap, 0, count + 1);
30 WARN(psdrv, "HeapAlloc failed\n");
34 if(dc->w.textAlign & TA_UPDATECP) {
42 GetTextExtentPoint32A(dc->hSelf, str, count, &sz);
43 sz.cx = XLSTODS(dc, sz.cx);
44 sz.cy = YLSTODS(dc, sz.cy);
46 switch(dc->w.textAlign & (TA_LEFT | TA_CENTER | TA_RIGHT) ) {
48 if(dc->w.textAlign & TA_UPDATECP)
49 dc->w.CursPosX = XDPTOLP(dc, x + sz.cx);
58 if(dc->w.textAlign & TA_UPDATECP)
59 dc->w.CursPosX = XDPTOLP(dc, x);
63 switch(dc->w.textAlign & (TA_TOP | TA_BASELINE | TA_BOTTOM) ) {
65 y += physDev->font.tm.tmAscent;
72 y -= physDev->font.tm.tmDescent;
76 memcpy(strbuf, str, count);
77 *(strbuf + count) = '\0';
81 PSDRV_WriteMoveTo(dc, x, y);
82 PSDRV_WriteShow(dc, strbuf, strlen(strbuf));
84 HeapFree(PSDRV_Heap, 0, strbuf);