Commit 20070d08 authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Implement GetTextMetrics as a standard driver entry point.

parent ca417799
......@@ -1222,17 +1222,13 @@ BOOL WINAPI GetTextMetricsA( HDC hdc, TEXTMETRICA *metrics )
*/
BOOL WINAPI GetTextMetricsW( HDC hdc, TEXTMETRICW *metrics )
{
PHYSDEV physdev;
BOOL ret = FALSE;
DC * dc = get_dc_ptr( hdc );
if (!dc) return FALSE;
if (dc->gdiFont)
ret = WineEngGetTextMetrics(dc->gdiFont, metrics);
else
{
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pGetTextMetrics );
physdev = GET_DC_PHYSDEV( dc, pGetTextMetrics );
ret = physdev->funcs->pGetTextMetrics( physdev, metrics );
}
if (ret)
{
......
......@@ -6209,16 +6209,22 @@ DWORD WineEngGetGlyphOutline(GdiFont *font, UINT glyph, UINT format,
}
/*************************************************************
* WineEngGetTextMetrics
*
* freetype_GetTextMetrics
*/
BOOL WineEngGetTextMetrics(GdiFont *font, LPTEXTMETRICW ptm)
static BOOL freetype_GetTextMetrics( PHYSDEV dev, TEXTMETRICW *metrics )
{
struct freetype_physdev *physdev = get_freetype_dev( dev );
BOOL ret;
if (!physdev->font)
{
dev = GET_NEXT_PHYSDEV( dev, pGetTextMetrics );
return dev->funcs->pGetTextMetrics( dev, metrics );
}
GDI_CheckNotLock();
EnterCriticalSection( &freetype_cs );
ret = get_text_metrics( font, ptm );
ret = get_text_metrics( physdev->font, metrics );
LeaveCriticalSection( &freetype_cs );
return ret;
}
......@@ -7089,7 +7095,7 @@ static const struct gdi_dc_funcs freetype_funcs =
NULL, /* pGetPixelFormat */
NULL, /* pGetSystemPaletteEntries */
freetype_GetTextExtentExPoint, /* pGetTextExtentExPoint */
NULL, /* pGetTextMetrics */
freetype_GetTextMetrics, /* pGetTextMetrics */
NULL, /* pIntersectClipRect */
NULL, /* pInvertRgn */
NULL, /* pLineTo */
......@@ -7196,12 +7202,6 @@ DWORD WineEngGetGlyphOutline(GdiFont *font, UINT glyph, UINT format,
return GDI_ERROR;
}
BOOL WineEngGetTextMetrics(GdiFont *font, LPTEXTMETRICW ptm)
{
ERR("called but we don't have FreeType\n");
return FALSE;
}
UINT WineEngGetOutlineTextMetrics(GdiFont *font, UINT cbSize,
OUTLINETEXTMETRICW *potm)
{
......
......@@ -312,7 +312,6 @@ extern UINT WineEngGetOutlineTextMetrics(GdiFont*, UINT, LPOUTLINETEXTMETRICW) D
extern UINT WineEngGetTextCharsetInfo(GdiFont *font, LPFONTSIGNATURE fs, DWORD flags) 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;
extern BOOL WineEngFontIsLinked(GdiFont*) DECLSPEC_HIDDEN;
extern BOOL WineEngInit(void) DECLSPEC_HIDDEN;
extern BOOL WineEngRealizationInfo(GdiFont*, realization_info_t*) 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