Module: wine Branch: master Commit: aa90ed6df69791c03219cd1cdcf82da9ec5af4c4 URL: https://source.winehq.org/git/wine.git/?a=commit;h=aa90ed6df69791c03219cd1cd...
Author: Alexandre Julliard julliard@winehq.org Date: Sat May 2 15:07:28 2020 +0200
gdi32: Return 0 char width for missing glyphs.
Fixes a test failure with Emoji font: font.c:7147: Test failed: Noto Color Emoji: mismatched widths 2145357798/1.33654768e+008
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/gdi32/freetype.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 31ad56706a..f68198df8b 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -8414,8 +8414,10 @@ static BOOL CDECL freetype_GetCharWidth( PHYSDEV dev, UINT firstChar, UINT lastC GDI_CheckNotLock(); EnterCriticalSection( &freetype_cs ); for(c = firstChar; c <= lastChar; c++) { - get_glyph_outline( physdev->font, c, GGO_METRICS, &gm, &abc, 0, NULL, &identity ); - buffer[c - firstChar] = abc.abcA + abc.abcB + abc.abcC; + if (get_glyph_outline( physdev->font, c, GGO_METRICS, &gm, &abc, 0, NULL, &identity ) == GDI_ERROR) + buffer[c - firstChar] = 0; + else + buffer[c - firstChar] = abc.abcA + abc.abcB + abc.abcC; } LeaveCriticalSection( &freetype_cs ); return TRUE;