d3dx10/font: Implement GetTextMetrics().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2021-08-30 08:08:10 +03:00 committed by Alexandre Julliard
parent 5e0577c2b8
commit 107562fdbf
2 changed files with 9 additions and 8 deletions

View File

@ -132,16 +132,20 @@ static HRESULT WINAPI d3dx_font_GetDescW(ID3DX10Font *iface, D3DX10_FONT_DESCW *
static BOOL WINAPI d3dx_font_GetTextMetricsA(ID3DX10Font *iface, TEXTMETRICA *metrics)
{
FIXME("iface %p, metrics %p stub!\n", iface, metrics);
struct d3dx_font *font = impl_from_ID3DX10Font(iface);
return FALSE;
TRACE("iface %p, metrics %p.\n", iface, metrics);
return GetTextMetricsA(font->hdc, metrics);
}
static BOOL WINAPI d3dx_font_GetTextMetricsW(ID3DX10Font *iface, TEXTMETRICW *metrics)
{
FIXME("iface %p, metrics %p stub!\n", iface, metrics);
struct d3dx_font *font = impl_from_ID3DX10Font(iface);
return FALSE;
TRACE("iface %p, metrics %p.\n", iface, metrics);
return GetTextMetricsW(font->hdc, metrics);
}
static HDC WINAPI d3dx_font_GetDC(ID3DX10Font *iface)

View File

@ -2206,11 +2206,8 @@ static void test_font(void)
ok(ret, "Unexpected ret %#x.\n", ret);
ret = ID3DX10Font_GetTextMetricsA(font, &metrics);
todo_wine
ok(ret, "Unexpected ret %#x.\n", ret);
if (ret)
{
ok(metrics.tmHeight == expmetrics.tmHeight, "Unexpected height %d, expected %d.\n",
metrics.tmHeight, expmetrics.tmHeight);
ok(metrics.tmAscent == expmetrics.tmAscent, "Unexpected ascent %d, expected %d.\n",
@ -2251,7 +2248,7 @@ if (ret)
metrics.tmPitchAndFamily, expmetrics.tmPitchAndFamily);
ok(metrics.tmCharSet == expmetrics.tmCharSet, "Unexpected charset %u, expected %u.\n",
metrics.tmCharSet, expmetrics.tmCharSet);
}
ID3DX10Font_Release(font);
/* PreloadText */