2 * win16 driver text functions
4 * Copyright 1996 John Harvey
12 #include "debugtools.h"
15 DEFAULT_DEBUG_CHANNEL(win16drv
)
17 /***********************************************************************
20 BOOL
WIN16DRV_ExtTextOut( DC
*dc
, INT x
, INT y
, UINT flags
,
21 const RECT
*lprect
, LPCWSTR wstr
, UINT count
,
24 WIN16DRV_PDEVICE
*physDev
= (WIN16DRV_PDEVICE
*)dc
->physDev
;
28 RECT16
*lpOpaqueRect
= NULL
;
38 TRACE("%04x %d %d %x %p %s %p\n",
39 dc
->hSelf
, x
, y
, flags
, lprect
, debugstr_wn(wstr
, count
), lpDx
);
41 str
= HeapAlloc( GetProcessHeap(), 0, count
+1 );
42 lstrcpynWtoA( str
, wstr
, count
+1 );
47 clipRect
.right
= dc
->w
.devCaps
->horzRes
;
48 clipRect
.bottom
= dc
->w
.devCaps
->vertRes
;
50 opaqueRect
.left
= lprect
->left
;
51 opaqueRect
.top
= lprect
->top
;
52 opaqueRect
.right
= lprect
->right
;
53 opaqueRect
.bottom
= lprect
->bottom
;
54 lpOpaqueRect
= &opaqueRect
;
57 TRACE("textalign = %d\n", dc
->w
.textAlign
);
59 if (dc
->w
.textAlign
& TA_UPDATECP
) {
67 dwRet
= PRTDRV_ExtTextOut(physDev
->segptrPDEVICE
, 0, 0,
68 NULL
, str
, -count
, physDev
->FontInfo
,
69 win16drv_SegPtr_DrawMode
,
70 win16drv_SegPtr_TextXForm
,
73 width
= LOWORD(dwRet
);
75 switch( dc
->w
.textAlign
& (TA_LEFT
| TA_RIGHT
| TA_CENTER
) ) {
77 if (dc
->w
.textAlign
& TA_UPDATECP
)
78 dc
->w
.CursPosX
= XDPTOLP( dc
, x
+ width
);
82 if (dc
->w
.textAlign
& TA_UPDATECP
)
83 dc
->w
.CursPosX
= XDPTOLP( dc
, x
);
90 switch( dc
->w
.textAlign
& (TA_TOP
| TA_BOTTOM
| TA_BASELINE
) ) {
94 y
-= physDev
->FontInfo
->dfPixHeight
;
97 y
-= physDev
->FontInfo
->dfAscent
;
101 dwRet
= PRTDRV_ExtTextOut(physDev
->segptrPDEVICE
,
102 x
, y
, &clipRect
, str
, wCount
,
103 physDev
->FontInfo
, win16drv_SegPtr_DrawMode
,
104 win16drv_SegPtr_TextXForm
, NULL
, lpOpaqueRect
,
107 HeapFree( GetProcessHeap(), 0, str
);