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>
feature/deterministic
Alexandre Julliard 2020-05-02 15:07:28 +02:00
parent 7da087b76a
commit aa90ed6df6
1 changed files with 4 additions and 2 deletions

View File

@ -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;