diff options
Diffstat (limited to 'app/wlib/mswlib/mswdraw.c')
-rw-r--r-- | app/wlib/mswlib/mswdraw.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/wlib/mswlib/mswdraw.c b/app/wlib/mswlib/mswdraw.c index 498b49e..652dde3 100644 --- a/app/wlib/mswlib/mswdraw.c +++ b/app/wlib/mswlib/mswdraw.c @@ -698,6 +698,8 @@ void wDrawGetTextSize( HFONT newFont, prevFont; DWORD extent; int oldLfHeight; + TEXTMETRIC textMetric; + if (fp == NULL) fp = &logFont; fp->lfEscapement = 0; @@ -707,11 +709,15 @@ void wDrawGetTextSize( newFont = CreateFontIndirect( fp ); prevFont = SelectObject( bd->hDc, newFont ); extent = GetTextExtent( bd->hDc, CAST_AWAY_CONST text, strlen(text) ); + + GetTextMetrics(bd->hDc, &textMetric); + x = LOWORD(extent); y = HIWORD(extent); *w = XPIXELSTOINCH( bd, x ); *h = YPIXELSTOINCH( bd, y ); - *d = 0; + *d = YPIXELSTOINCH(bd, textMetric.tmDescent ); + SelectObject( bd->hDc, prevFont ); DeleteObject( newFont ); fp->lfHeight = oldLfHeight; |