gdi32: Implement GetTextExtentExPointW as a standard driver entry point.

This commit is contained in:
Alexandre Julliard 2011-10-18 22:00:16 +02:00
parent c66b611205
commit 6ad9eb805c
3 changed files with 17 additions and 25 deletions

View File

@ -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)

View File

@ -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 );
TRACE("%p, %s, %d, %d, %p\n", font, debugstr_wn(wstr, count), count,
max_ext, size);
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", 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)
{

View File

@ -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;