2 * win16 driver text functions
4 * Copyright 1996 John Harvey
16 /***********************************************************************
19 BOOL32 WIN16DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
20 const RECT32 *lprect, LPCSTR str, UINT32 count,
23 WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
27 RECT16 *lpOpaqueRect = NULL;
35 dprintf_win16drv(stddeb, "WIN16DRV_ExtTextOut: %04x %d %d %x %p %*s %p\n",
36 dc->hSelf, x, y, flags, lprect, count > 0 ? count : 8, str, lpDx);
46 clipRect.right = dc->w.devCaps->horzRes;
47 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;
58 dprintf_win16drv(stddeb, "textalign = %d\n", dc->w.textAlign);
60 if (dc->w.textAlign & TA_UPDATECP)
69 dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE, 0, 0,
70 NULL, str, -count, physDev->FontInfo,
71 win16drv_SegPtr_DrawMode, win16drv_SegPtr_TextXForm,
74 width = LOWORD(dwRet);
76 switch( dc->w.textAlign & (TA_LEFT | TA_RIGHT | TA_CENTER) )
79 if (dc->w.textAlign & TA_UPDATECP)
80 dc->w.CursPosX = XDPTOLP( dc, x + width );
84 if (dc->w.textAlign & TA_UPDATECP)
85 dc->w.CursPosX = XDPTOLP( dc, x );
92 switch( dc->w.textAlign & (TA_TOP | TA_BOTTOM | TA_BASELINE) )
97 y -= physDev->FontInfo->dfPixHeight;
100 y -= physDev->FontInfo->dfAscent;
104 dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE,
105 x, y, &clipRect, str, wCount,
106 physDev->FontInfo, win16drv_SegPtr_DrawMode,
107 win16drv_SegPtr_TextXForm, NULL, lpOpaqueRect, wOptions);