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) ...@@ -366,7 +366,7 @@ void get_glyph_name(HDC hdc, WORD index, char *name)
* Download and write out a number of glyphs * 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) UINT count)
{ {
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev ); PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
......
...@@ -539,7 +539,7 @@ extern BOOL PSDRV_WriteBuiltinGlyphShow(PHYSDEV dev, LPCWSTR str, INT count) DEC ...@@ -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_SelectDownloadFont(PHYSDEV dev) DECLSPEC_HIDDEN;
extern BOOL PSDRV_WriteSetDownloadFont(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 BOOL PSDRV_EmptyDownloadList(PHYSDEV dev, BOOL write_undef) DECLSPEC_HIDDEN;
extern DWORD write_spool( PHYSDEV dev, const void *data, DWORD num ) 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, ...@@ -100,14 +100,18 @@ static BOOL PSDRV_Text(PHYSDEV dev, INT x, INT y, UINT flags, LPCWSTR str,
if (!count) if (!count)
return TRUE; return TRUE;
if(physDev->font.fontloc == Download) if(physDev->font.fontloc == Download && !(flags & ETO_GLYPH_INDEX))
glyphs = (LPWORD)str; {
glyphs = HeapAlloc( GetProcessHeap(), 0, count * sizeof(WORD) );
GetGlyphIndicesW( dev->hdc, str, count, glyphs, 0 );
str = glyphs;
}
PSDRV_WriteMoveTo(dev, x, y); PSDRV_WriteMoveTo(dev, x, y);
if(!lpDx) { if(!lpDx) {
if(physDev->font.fontloc == Download) if(physDev->font.fontloc == Download)
PSDRV_WriteDownloadGlyphShow(dev, glyphs, count); PSDRV_WriteDownloadGlyphShow(dev, str, count);
else else
PSDRV_WriteBuiltinGlyphShow(dev, str, count); PSDRV_WriteBuiltinGlyphShow(dev, str, count);
} }
...@@ -117,7 +121,7 @@ static BOOL PSDRV_Text(PHYSDEV dev, INT x, INT y, UINT flags, LPCWSTR str, ...@@ -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++) { for(i = 0; i < count-1; i++) {
if(physDev->font.fontloc == Download) if(physDev->font.fontloc == Download)
PSDRV_WriteDownloadGlyphShow(dev, glyphs + i, 1); PSDRV_WriteDownloadGlyphShow(dev, str + i, 1);
else else
PSDRV_WriteBuiltinGlyphShow(dev, str + i, 1); PSDRV_WriteBuiltinGlyphShow(dev, str + i, 1);
if(flags & ETO_PDY) if(flags & ETO_PDY)
...@@ -130,10 +134,11 @@ static BOOL PSDRV_Text(PHYSDEV dev, INT x, INT y, UINT flags, LPCWSTR str, ...@@ -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); PSDRV_WriteMoveTo(dev, x + offset.x, y + offset.y);
} }
if(physDev->font.fontloc == Download) if(physDev->font.fontloc == Download)
PSDRV_WriteDownloadGlyphShow(dev, glyphs + i, 1); PSDRV_WriteDownloadGlyphShow(dev, str + i, 1);
else else
PSDRV_WriteBuiltinGlyphShow(dev, str + i, 1); PSDRV_WriteBuiltinGlyphShow(dev, str + i, 1);
} }
HeapFree( GetProcessHeap(), 0, glyphs );
return TRUE; 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