From 3062c00c70e85deebc65201d8ab28cfb8beb5d86 Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Thu, 26 Oct 2017 11:59:41 +0900 Subject: [PATCH] adjustment of TextMetrics --- win32ss/gdi/ntgdi/freetype.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c index eb2fc7756d..e83939bbca 100644 --- a/win32ss/gdi/ntgdi/freetype.c +++ b/win32ss/gdi/ntgdi/freetype.c @@ -1566,10 +1566,10 @@ FillTMEx(TEXTMETRICW *TM, PFONTGDI FontGDI, TM->tmAscent = (FT_MulFix(Ascent, YScale) + 32) >> 6; TM->tmDescent = (FT_MulFix(Descent, YScale) + 32) >> 6; #else /* This (ros) code was previously affected by a FreeType bug, but it works now */ - TM->tmAscent = (Face->size->metrics.ascender + 32) >> 6; /* Units above baseline */ - TM->tmDescent = (32 - Face->size->metrics.descender) >> 6; /* Units below baseline */ + TM->tmAscent = FT_MulFix(Face->ascender, Face->size->metrics.y_scale) >> 6; + TM->tmDescent = -FT_MulFix(Face->descender, Face->size->metrics.y_scale) >> 6; #endif - TM->tmInternalLeading = (FT_MulFix(Ascent + Descent - Face->units_per_EM, YScale) + 32) >> 6; + TM->tmInternalLeading = FT_MulFix(Ascent + Descent - Face->units_per_EM, YScale) >> 6; TM->tmHeight = TM->tmAscent + TM->tmDescent; -- 2.14.2