[PATCH 0/1] MR11072: win32u: Fixed negative glyph outline size
freetype_get_glyph_outline was creating negative metrics when top was less than bottom in our height clipping, created either massive blackboxY values or negative sizes Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58314 -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11072
From: Kellen Kopp <kellen.kopp@outlook.com> freetype_get_glyph_outline was creating incorrect metrics when top was less than bottom in our height clipping Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58314 --- dlls/win32u/freetype.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/win32u/freetype.c b/dlls/win32u/freetype.c index a660b166a0f..41e6228b58c 100644 --- a/dlls/win32u/freetype.c +++ b/dlls/win32u/freetype.c @@ -3149,6 +3149,14 @@ static UINT freetype_get_glyph_outline( struct gdi_font *font, UINT glyph, UINT TEXTMETRICW *ptm = &base_font->otm.otmTextMetrics; INT top = min( metrics.horiBearingY, ptm->tmAscent << 6 ); INT bottom = max( metrics.horiBearingY - metrics.height, -(ptm->tmDescent << 6) ); + + if ( top < bottom ) + { + INT t = top; + top = bottom; + bottom = t; + } + metrics.horiBearingY = top; metrics.height = top - bottom; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11072
This merge request was approved by Huw Davies. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11072
This merge request was approved by Kellen Kopp. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11072
participants (3)
-
Huw Davies (@huw) -
Kellen Kopp -
Kellen Kopp (@kellen-kopp)