[1/2] wineps.drv: Implement GetGlyphIndices.
Dmitry Timoshkov
dmitry at baikal.ru
Tue Jan 22 02:18:32 CST 2013
ExtTextOutW calls GetTextExtentExPointI for the (char_extra || dc->breakExtra)
case, and one of its helpers unconditionally calls dc->GetGlyphIndices and
dc->GetTextExtentExPointI which crashes for a wineps.drv device.
These 2 patches make ExtTextOutW work in this case.
---
dlls/wineps.drv/builtin.c | 18 ++++++++++++++++++
dlls/wineps.drv/init.c | 3 +--
dlls/wineps.drv/psdrv.h | 1 +
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/dlls/wineps.drv/builtin.c b/dlls/wineps.drv/builtin.c
index e2106d3..a799a00 100644
--- a/dlls/wineps.drv/builtin.c
+++ b/dlls/wineps.drv/builtin.c
@@ -258,6 +258,24 @@ BOOL PSDRV_WriteBuiltinGlyphShow(PHYSDEV dev, LPCWSTR str, INT count)
}
/***********************************************************************
+ * PSDRV_GetGlyphIndices
+ */
+DWORD PSDRV_GetGlyphIndices(PHYSDEV dev, LPCWSTR str, INT count,
+ LPWORD idx, DWORD flags)
+{
+ PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
+
+ if (physDev->font.fontloc == Download)
+ {
+ dev = GET_NEXT_PHYSDEV( dev, pGetGlyphIndices );
+ return dev->funcs->pGetGlyphIndices( dev, str, count, idx, flags );
+ }
+
+ /* FIXME */
+ return 0;
+}
+
+/***********************************************************************
* PSDRV_GetTextMetrics
*/
BOOL PSDRV_GetTextMetrics(PHYSDEV dev, TEXTMETRICW *metrics)
diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c
index 5439ff5..83a5640 100644
--- a/dlls/wineps.drv/init.c
+++ b/dlls/wineps.drv/init.c
@@ -35,7 +35,6 @@
#include "winnls.h"
#include "psdrv.h"
#include "winspool.h"
-#include "wine/library.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
@@ -773,7 +772,7 @@ static const struct gdi_dc_funcs psdrv_funcs =
NULL, /* pGetDeviceGammaRamp */
NULL, /* pGetFontData */
NULL, /* pGetFontUnicodeRanges */
- NULL, /* pGetGlyphIndices */
+ PSDRV_GetGlyphIndices, /* pGetGlyphIndices */
NULL, /* pGetGlyphOutline */
NULL, /* pGetICMProfile */
NULL, /* pGetImage */
diff --git a/dlls/wineps.drv/psdrv.h b/dlls/wineps.drv/psdrv.h
index ffae328..470f4c8 100644
--- a/dlls/wineps.drv/psdrv.h
+++ b/dlls/wineps.drv/psdrv.h
@@ -433,6 +433,7 @@ extern BOOL PSDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
const RECT *lprect, LPCWSTR str, UINT count, const INT *lpDx ) DECLSPEC_HIDDEN;
extern BOOL PSDRV_FillPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL PSDRV_GetCharWidth(PHYSDEV dev, UINT firstChar, UINT lastChar, LPINT buffer) DECLSPEC_HIDDEN;
+extern DWORD PSDRV_GetGlyphIndices(PHYSDEV dev, LPCWSTR str, INT count, LPWORD idx, DWORD flags) DECLSPEC_HIDDEN;
extern BOOL PSDRV_GetTextExtentExPoint(PHYSDEV dev, LPCWSTR str, INT count, LPINT alpDx) DECLSPEC_HIDDEN;
extern BOOL PSDRV_GetTextMetrics(PHYSDEV dev, TEXTMETRICW *metrics) DECLSPEC_HIDDEN;
extern BOOL PSDRV_LineTo(PHYSDEV dev, INT x, INT y) DECLSPEC_HIDDEN;
--
1.8.0.2
More information about the wine-patches
mailing list