From: Tarcísio Ladeia de Oliveirawyrquill@gmail.com
--- dlls/win32u/font.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/dlls/win32u/font.c b/dlls/win32u/font.c index ca0e52be07f..a5e64294182 100644 --- a/dlls/win32u/font.c +++ b/dlls/win32u/font.c @@ -3390,13 +3390,23 @@ static BOOL get_face_enum_data( struct gdi_font_face *face, ENUMLOGFONTEXW *elf, #define SCALE_NTM(value) (muldiv( ntm->ntmTm.tmHeight, (value), TM.tmHeight )) cell_height = TM.tmHeight / ( -lf.lfHeight / font->otm.otmEMSquare ); ntm->ntmTm.tmHeight = muldiv( ntm_ppem, cell_height, font->otm.otmEMSquare ); - ntm->ntmTm.tmAscent = SCALE_NTM( TM.tmAscent ); ntm->ntmTm.tmDescent = ntm->ntmTm.tmHeight - ntm->ntmTm.tmAscent; - ntm->ntmTm.tmInternalLeading = SCALE_NTM( TM.tmInternalLeading ); - ntm->ntmTm.tmExternalLeading = SCALE_NTM( TM.tmExternalLeading ); - ntm->ntmTm.tmAveCharWidth = SCALE_NTM( TM.tmAveCharWidth ); - ntm->ntmTm.tmMaxCharWidth = SCALE_NTM( TM.tmMaxCharWidth ); - + if (TM.tmHeight != 0) + { + ntm->ntmTm.tmAscent = SCALE_NTM( TM.tmAscent ); + ntm->ntmTm.tmInternalLeading = SCALE_NTM( TM.tmInternalLeading ); + ntm->ntmTm.tmExternalLeading = SCALE_NTM( TM.tmExternalLeading ); + ntm->ntmTm.tmAveCharWidth = SCALE_NTM( TM.tmAveCharWidth ); + ntm->ntmTm.tmMaxCharWidth = SCALE_NTM( TM.tmMaxCharWidth ); + } + else + { + ntm->ntmTm.tmAscent = 0; + ntm->ntmTm.tmInternalLeading = 0; + ntm->ntmTm.tmExternalLeading = 0; + ntm->ntmTm.tmAveCharWidth = 0; + ntm->ntmTm.tmMaxCharWidth = 0; + } memcpy((char *)&ntm->ntmTm + offsetof( TEXTMETRICW, tmWeight ), (const char *)&TM + offsetof( TEXTMETRICW, tmWeight ), sizeof(TEXTMETRICW) - offsetof( TEXTMETRICW, tmWeight ));