Commit 6ad9eb80 authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Implement GetTextExtentExPointW as a standard driver entry point.

parent c66b6112
......@@ -1116,6 +1116,7 @@ BOOL WINAPI GetTextExtentExPointW( HDC hdc, LPCWSTR str, INT count,
DC *dc;
BOOL ret = FALSE;
TEXTMETRICW tm;
PHYSDEV dev;
TRACE("(%p, %s, %d)\n",hdc,debugstr_wn(str,count),maxExt);
......@@ -1141,14 +1142,8 @@ BOOL WINAPI GetTextExtentExPointW( HDC hdc, LPCWSTR str, INT count,
else
dxs = alpDx;
if (dc->gdiFont)
ret = WineEngGetTextExtentExPoint(dc->gdiFont, str, count,
0, NULL, dxs, size);
else
{
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pGetTextExtentExPoint );
ret = physdev->funcs->pGetTextExtentExPoint(physdev, str, count, 0, NULL, dxs, size);
}
dev = GET_DC_PHYSDEV( dc, pGetTextExtentExPoint );
ret = dev->funcs->pGetTextExtentExPoint(dev, str, count, 0, NULL, dxs, size);
/* Perform device size to world size transformations. */
if (ret)
......
......@@ -6445,11 +6445,10 @@ BOOL WineEngGetCharABCWidthsI(GdiFont *font, UINT firstChar, UINT count, LPWORD
}
/*************************************************************
* WineEngGetTextExtentExPoint
*
* freetype_GetTextExtentExPoint
*/
BOOL WineEngGetTextExtentExPoint(GdiFont *font, LPCWSTR wstr, INT count,
INT max_ext, LPINT pnfit, LPINT dxs, LPSIZE size)
static BOOL freetype_GetTextExtentExPoint( PHYSDEV dev, LPCWSTR wstr, INT count,
INT max_ext, LPINT pnfit, LPINT dxs, LPSIZE size)
{
static const MAT2 identity = { {0,1},{0,0},{0,0},{0,1} };
INT idx;
......@@ -6458,19 +6457,25 @@ BOOL WineEngGetTextExtentExPoint(GdiFont *font, LPCWSTR wstr, INT count,
TEXTMETRICW tm;
FT_UInt glyph_index;
GdiFont *linked_font;
struct freetype_physdev *physdev = get_freetype_dev( dev );
if (!physdev->font)
{
dev = GET_NEXT_PHYSDEV( dev, pGetTextExtentExPoint );
return dev->funcs->pGetTextExtentExPoint( dev, wstr, count, max_ext, pnfit, dxs, size );
}
TRACE("%p, %s, %d, %d, %p\n", font, debugstr_wn(wstr, count), count,
max_ext, size);
TRACE("%p, %s, %d, %d, %p\n", physdev->font, debugstr_wn(wstr, count), count, max_ext, size);
GDI_CheckNotLock();
EnterCriticalSection( &freetype_cs );
size->cx = 0;
WineEngGetTextMetrics(font, &tm);
WineEngGetTextMetrics( physdev->font, &tm );
size->cy = tm.tmHeight;
for(idx = 0; idx < count; idx++) {
get_glyph_index_linked(font, wstr[idx], &linked_font, &glyph_index);
get_glyph_index_linked( physdev->font, wstr[idx], &linked_font, &glyph_index );
WineEngGetGlyphOutline(linked_font, glyph_index, GGO_METRICS | GGO_GLYPH_INDEX,
&gm, 0, NULL, &identity);
size->cx += FONT_GM(linked_font,glyph_index)->adv;
......@@ -7080,7 +7085,7 @@ static const struct gdi_dc_funcs freetype_funcs =
NULL, /* pGetPixel */
NULL, /* pGetPixelFormat */
NULL, /* pGetSystemPaletteEntries */
NULL, /* pGetTextExtentExPoint */
freetype_GetTextExtentExPoint, /* pGetTextExtentExPoint */
NULL, /* pGetTextMetrics */
NULL, /* pIntersectClipRect */
NULL, /* pInvertRgn */
......@@ -7228,13 +7233,6 @@ BOOL WineEngGetCharABCWidthsI(GdiFont *font, UINT firstChar, UINT count, LPWORD
return FALSE;
}
BOOL WineEngGetTextExtentExPoint(GdiFont *font, LPCWSTR wstr, INT count,
INT max_ext, LPINT nfit, LPINT dx, LPSIZE size)
{
ERR("called but we don't have FreeType\n");
return FALSE;
}
BOOL WineEngGetTextExtentExPointI(GdiFont *font, const WORD *indices, INT count,
INT max_ext, LPINT nfit, LPINT dx, LPSIZE size)
{
......
......@@ -311,7 +311,6 @@ extern DWORD WineEngGetKerningPairs(GdiFont*, DWORD, KERNINGPAIR *) DECLSPEC_HID
extern BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph) DECLSPEC_HIDDEN;
extern UINT WineEngGetOutlineTextMetrics(GdiFont*, UINT, LPOUTLINETEXTMETRICW) DECLSPEC_HIDDEN;
extern UINT WineEngGetTextCharsetInfo(GdiFont *font, LPFONTSIGNATURE fs, DWORD flags) DECLSPEC_HIDDEN;
extern BOOL WineEngGetTextExtentExPoint(GdiFont*, LPCWSTR, INT, INT, LPINT, LPINT, LPSIZE) DECLSPEC_HIDDEN;
extern BOOL WineEngGetTextExtentExPointI(GdiFont*, const WORD *, INT, INT, LPINT, LPINT, LPSIZE) DECLSPEC_HIDDEN;
extern INT WineEngGetTextFace(GdiFont*, INT, LPWSTR) DECLSPEC_HIDDEN;
extern BOOL WineEngGetTextMetrics(GdiFont*, LPTEXTMETRICW) DECLSPEC_HIDDEN;
......
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