https://git.reactos.org/?p=reactos.git;a=commitdiff;h=85ae8421055f51eac48cb…
commit 85ae8421055f51eac48cb3d8acce47a7cd715982
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Wed Oct 25 18:10:36 2017 +0900
[WIN32SS] fix font extent.
CORE-13840
---
win32ss/gdi/ntgdi/freetype.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c
index ca1af462c5..eb2fc7756d 100644
--- a/win32ss/gdi/ntgdi/freetype.c
+++ b/win32ss/gdi/ntgdi/freetype.c
@@ -3570,6 +3570,7 @@ TextIntGetTextExtentPoint(PDC dc,
PMATRIX pmxWorldToDevice;
LOGFONTW *plf;
BOOL EmuBold, EmuItalic;
+ LONG ascender, descender;
FontGDI = ObjToGDI(TextObj->Font, FONT);
@@ -3676,13 +3677,12 @@ TextIntGetTextExtentPoint(PDC dc,
previous = glyph_index;
String++;
}
+ ascender = (face->size->metrics.ascender + 32) >> 6; /* Units above
baseline */
+ descender = (32 - face->size->metrics.descender) >> 6; /* Units below
baseline */
IntUnLockFreeType;
Size->cx = (TotalWidth + 32) >> 6;
- Size->cy = (plf->lfHeight == 0 ?
- dc->ppdev->devinfo.lfDefaultFont.lfHeight :
- abs(plf->lfHeight));
- Size->cy = EngMulDiv(Size->cy, dc->ppdev->gdiinfo.ulLogPixelsY, 72);
+ Size->cy = ascender + descender;
return TRUE;
}