From aff56c42abd7b1de57642007d50fcc725961b64a Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Wed, 21 Dec 2022 20:51:35 +0000 Subject: [PATCH] Fix #10151: Use otmAscent instead of otmTextMetrics.tmAscent [Windows] These metrics more closely match the the sprite font, but do result in a more cramped line-height. --- src/os/windows/font_win32.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/os/windows/font_win32.cpp b/src/os/windows/font_win32.cpp index ddc275fc45..a6c90e4932 100644 --- a/src/os/windows/font_win32.cpp +++ b/src/os/windows/font_win32.cpp @@ -185,8 +185,8 @@ void Win32FontCache::SetFontSize(int pixels) GetOutlineTextMetrics(this->dc, otmSize, otm); this->units_per_em = otm->otmEMSquare; - this->ascender = otm->otmTextMetrics.tmAscent; - this->descender = otm->otmTextMetrics.tmDescent; + this->ascender = otm->otmAscent; + this->descender = -otm->otmDescent; this->height = this->ascender + this->descender; this->glyph_size.cx = otm->otmTextMetrics.tmMaxCharWidth; this->glyph_size.cy = otm->otmTextMetrics.tmHeight;