2 * PostScript driver text functions
4 * Copyright 1998 Huw D M Davies
13 /***********************************************************************
16 BOOL32
PSDRV_ExtTextOut( DC
*dc
, INT32 x
, INT32 y
, UINT32 flags
,
17 const RECT32
*lprect
, LPCSTR str
, UINT32 count
,
20 PSDRV_PDEVICE
*physDev
= (PSDRV_PDEVICE
*)dc
->physDev
;
24 TRACE(psdrv
, "(x=%d, y=%d, flags=0x%08x, str='%s', count=%d)\n", x
, y
,
27 strbuf
= (char *)HeapAlloc( PSDRV_Heap
, 0, count
+ 1);
29 WARN(psdrv
, "HeapAlloc failed\n");
33 if(dc
->w
.textAlign
& TA_UPDATECP
) {
41 GetTextExtentPoint32A(dc
->hSelf
, str
, count
, &sz
);
42 sz
.cx
= XLSTODS(dc
, sz
.cx
);
43 sz
.cy
= YLSTODS(dc
, sz
.cy
);
45 switch(dc
->w
.textAlign
& (TA_LEFT
| TA_CENTER
| TA_RIGHT
) ) {
47 if(dc
->w
.textAlign
& TA_UPDATECP
)
48 dc
->w
.CursPosX
= XDPTOLP(dc
, x
+ sz
.cx
);
57 if(dc
->w
.textAlign
& TA_UPDATECP
)
58 dc
->w
.CursPosX
= XDPTOLP(dc
, x
);
62 switch(dc
->w
.textAlign
& (TA_TOP
| TA_BASELINE
| TA_BOTTOM
) ) {
64 y
+= physDev
->font
.tm
.tmAscent
;
71 y
-= physDev
->font
.tm
.tmDescent
;
75 memcpy(strbuf
, str
, count
);
76 *(strbuf
+ count
) = '\0';
80 PSDRV_WriteMoveTo(dc
, x
, y
);
81 PSDRV_WriteShow(dc
, strbuf
, strlen(strbuf
));
83 HeapFree(PSDRV_Heap
, 0, strbuf
);