2 * win16 driver text functions
4 * Copyright 1996 John Harvey
11 #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 len = WideCharToMultiByte( CP_ACP, 0, wstr, count, NULL, 0, NULL, NULL );
42 str = HeapAlloc( GetProcessHeap(), 0, len );
43 WideCharToMultiByte( CP_ACP, 0, wstr, count, str, len, NULL, NULL );
48 clipRect.right = physDev->DevCaps.horzRes;
49 clipRect.bottom = physDev->DevCaps.vertRes;
51 opaqueRect.left = lprect->left;
52 opaqueRect.top = lprect->top;
53 opaqueRect.right = lprect->right;
54 opaqueRect.bottom = lprect->bottom;
55 lpOpaqueRect = &opaqueRect;
58 TRACE("textalign = %d\n", dc->textAlign);
60 if (dc->textAlign & TA_UPDATECP) {
68 dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE, 0, 0,
69 NULL, str, -len, physDev->FontInfo,
70 win16drv_SegPtr_DrawMode,
71 win16drv_SegPtr_TextXForm,
74 width = LOWORD(dwRet);
76 switch( dc->textAlign & (TA_LEFT | TA_RIGHT | TA_CENTER) ) {
78 if (dc->textAlign & TA_UPDATECP)
79 dc->CursPosX = XDPTOLP( dc, x + width );
83 if (dc->textAlign & TA_UPDATECP)
84 dc->CursPosX = XDPTOLP( dc, x );
91 switch( dc->textAlign & (TA_TOP | TA_BOTTOM | TA_BASELINE) ) {
95 y -= physDev->FontInfo->dfPixHeight;
98 y -= physDev->FontInfo->dfAscent;
102 dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE,
103 x, y, &clipRect, str, (WORD)len,
104 physDev->FontInfo, win16drv_SegPtr_DrawMode,
105 win16drv_SegPtr_TextXForm, NULL, lpOpaqueRect,
108 HeapFree( GetProcessHeap(), 0, str );