From af2e7eb2cbfd66c580bfa34c438ff055bc946ccd Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Mon, 18 Jul 2005 18:08:30 +0000 Subject: [PATCH] Test to show that the height returned by GetTextExtentPoint is the same as tmHeight. --- dlls/gdi/tests/gdiobj.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/dlls/gdi/tests/gdiobj.c b/dlls/gdi/tests/gdiobj.c index dc1f76d623f..deed86fc3b1 100644 --- a/dlls/gdi/tests/gdiobj.c +++ b/dlls/gdi/tests/gdiobj.c @@ -301,10 +301,35 @@ static void test_GdiGetCharDimensions(void) DeleteDC(hdc); } +static void test_text_extents(void) +{ + LOGFONTA lf; + TEXTMETRICA tm; + HDC hdc; + HFONT hfont; + SIZE sz; + + memset(&lf, 0, sizeof(lf)); + strcpy(lf.lfFaceName, "Arial"); + lf.lfHeight = 20; + + hfont = CreateFontIndirectA(&lf); + hdc = GetDC(0); + hfont = SelectObject(hdc, hfont); + GetTextMetricsA(hdc, &tm); + GetTextExtentPointA(hdc, "o", 1, &sz); + ok(sz.cy == tm.tmHeight, "cy %ld tmHeight %ld\n", sz.cy, tm.tmHeight); + + SelectObject(hdc, hfont); + DeleteObject(hfont); + ReleaseDC(NULL, hdc); +} + START_TEST(gdiobj) { test_logfont(); test_bitmap_font(); test_gdi_objects(); test_GdiGetCharDimensions(); + test_text_extents(); }