Commit 55353027 authored by Alexandre Julliard's avatar Alexandre Julliard

wineps: Support getting character codes instead of glyphs in ExtTextOut.

parent 491123e1
......@@ -366,7 +366,7 @@ void get_glyph_name(HDC hdc, WORD index, char *name)
* Download and write out a number of glyphs
*
*/
BOOL PSDRV_WriteDownloadGlyphShow(PHYSDEV dev, WORD *glyphs,
BOOL PSDRV_WriteDownloadGlyphShow(PHYSDEV dev, const WORD *glyphs,
UINT count)
{
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
......
......@@ -539,7 +539,7 @@ extern BOOL PSDRV_WriteBuiltinGlyphShow(PHYSDEV dev, LPCWSTR str, INT count) DEC
extern BOOL PSDRV_SelectDownloadFont(PHYSDEV dev) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteSetDownloadFont(PHYSDEV dev) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteDownloadGlyphShow(PHYSDEV dev, WORD *glpyhs, UINT count) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteDownloadGlyphShow(PHYSDEV dev, const WORD *glpyhs, UINT count) DECLSPEC_HIDDEN;
extern BOOL PSDRV_EmptyDownloadList(PHYSDEV dev, BOOL write_undef) DECLSPEC_HIDDEN;
extern DWORD write_spool( PHYSDEV dev, const void *data, DWORD num ) DECLSPEC_HIDDEN;
......
......@@ -100,14 +100,18 @@ static BOOL PSDRV_Text(PHYSDEV dev, INT x, INT y, UINT flags, LPCWSTR str,
if (!count)
return TRUE;
if(physDev->font.fontloc == Download)
glyphs = (LPWORD)str;
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, glyphs, count);
PSDRV_WriteDownloadGlyphShow(dev, str, count);
else
PSDRV_WriteBuiltinGlyphShow(dev, str, count);
}
......@@ -117,7 +121,7 @@ static BOOL PSDRV_Text(PHYSDEV dev, INT x, INT y, UINT flags, LPCWSTR str,
for(i = 0; i < count-1; i++) {
if(physDev->font.fontloc == Download)
PSDRV_WriteDownloadGlyphShow(dev, glyphs + i, 1);
PSDRV_WriteDownloadGlyphShow(dev, str + i, 1);
else
PSDRV_WriteBuiltinGlyphShow(dev, str + i, 1);
if(flags & ETO_PDY)
......@@ -130,10 +134,11 @@ static BOOL PSDRV_Text(PHYSDEV dev, INT x, INT y, UINT flags, LPCWSTR str,
PSDRV_WriteMoveTo(dev, x + offset.x, y + offset.y);
}
if(physDev->font.fontloc == Download)
PSDRV_WriteDownloadGlyphShow(dev, glyphs + i, 1);
PSDRV_WriteDownloadGlyphShow(dev, str + i, 1);
else
PSDRV_WriteBuiltinGlyphShow(dev, str + i, 1);
}
HeapFree( GetProcessHeap(), 0, glyphs );
return TRUE;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment