From: Tarcísio Ladeia de Oliveirawyrquill@gmail.com
--- dlls/win32u/freetype.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/dlls/win32u/freetype.c b/dlls/win32u/freetype.c index 3dfd8c5070f..26ab8e11cf7 100644 --- a/dlls/win32u/freetype.c +++ b/dlls/win32u/freetype.c @@ -2607,11 +2607,17 @@ static FT_Matrix *get_transform_matrices( struct gdi_font *font, BOOL vertical, matrices[matrix_unrotated] = identity_mat;
/* Scaling factor */ - if (font->aveWidth) + if (font->aveWidth && font->otm.otmTextMetrics.tmAveCharWidth) { if (!freetype_set_outline_text_metrics( font )) freetype_set_bitmap_text_metrics( font ); - width_ratio = (double)font->aveWidth; - width_ratio /= (double)font->otm.otmTextMetrics.tmAveCharWidth; + /* Metrics were recalculated, so test again */ + if (font->aveWidth && font->otm.otmTextMetrics.tmAveCharWidth) + { + width_ratio = (double)font->aveWidth; + width_ratio /= (double)font->otm.otmTextMetrics.tmAveCharWidth; + } + else + width_ratio = font->scale_y; } else width_ratio = font->scale_y;