/*********************************************************************** * PSDRV_Text */ static BOOL PSDRV_Text(PHYSDEV dev, INT x, INT y, UINT flags, LPCWSTR str, UINT count, BOOL bDrawBackground, const INT *lpDx) { PSDRV_PDEVICE *physDev = get_psdrv_dev( dev ); WORD *glyphs = NULL; if (!count) return TRUE; if(physDev->font.fontloc == Download && !(flags & ETO_GLYPH_INDEX)) { glyphs = HeapAlloc( GetProcessHeap(), 0, count * sizeof(WORD) ); GetGlyphIndicesW( dev->hdc, str, count, glyphs, 0 ); str = glyphs; } PSDRV_WriteMoveTo(dev, x, y); if(!lpDx) { if(physDev->font.fontloc == Download) PSDRV_WriteDownloadGlyphShow(dev, str, count); else PSDRV_WriteBuiltinGlyphShow(dev, str, count); } else { UINT i; POINT offset = {0, 0}; for(i = 0; i < count-1; i++) { if(physDev->font.fontloc == Download) PSDRV_WriteDownloadGlyphShow(dev, str + i, 1); else PSDRV_WriteBuiltinGlyphShow(dev, str + i, 1); if(flags & ETO_PDY) { offset.x += lpDx[i * 2]; offset.y += lpDx[i * 2 + 1]; } else offset.x += lpDx[i]; PSDRV_WriteMoveTo(dev, x + offset.x, y + offset.y); } if(physDev->font.fontloc == Download) PSDRV_WriteDownloadGlyphShow(dev, str + i, 1); else PSDRV_WriteBuiltinGlyphShow(dev, str + i, 1); } HeapFree( GetProcessHeap(), 0, glyphs ); return TRUE; }
/*********************************************************************** * PSDRV_Text */ static BOOL PSDRV_Text(PHYSDEV dev, INT x, INT y, UINT flags, LPCWSTR str, UINT count, BOOL bDrawBackground, const INT *lpDx) { PSDRV_PDEVICE *physDev = get_psdrv_dev( dev ); WORD *glyphs = NULL; if (!count) return TRUE; if(physDev->font.fontloc == Download) glyphs = (LPWORD)str; PSDRV_WriteMoveTo(dev, x, y); if(!lpDx) { if(physDev->font.fontloc == Download) PSDRV_WriteDownloadGlyphShow(dev, glyphs, count); else PSDRV_WriteBuiltinGlyphShow(dev, str, count); } else { UINT i; POINT offset = {0, 0}; for(i = 0; i < count-1; i++) { if(physDev->font.fontloc == Download) PSDRV_WriteDownloadGlyphShow(dev, glyphs + i, 1); else PSDRV_WriteBuiltinGlyphShow(dev, str + i, 1); if(flags & ETO_PDY) { offset.x += lpDx[i * 2]; offset.y += lpDx[i * 2 + 1]; } else offset.x += lpDx[i]; PSDRV_WriteMoveTo(dev, x + offset.x, y + offset.y); } if(physDev->font.fontloc == Download) PSDRV_WriteDownloadGlyphShow(dev, glyphs + i, 1); else PSDRV_WriteBuiltinGlyphShow(dev, str + i, 1); } return TRUE; }