From c483945cf45547d3533674527470788809c79bfb Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 8 Dec 2016 12:31:58 +0100 Subject: [PATCH] REG: Fix missing glyphs with DirectWrite and stretch == QFont::AnyStretch A stretch equal to 0 is since 5.8 defined as "accept the stretch of the font", and this needs to be accounted for in the font engines. Task-number: QTBUG-57491 Change-Id: Idabbe44677c4b92cbd8ad8278b054de53e9cc7f9 Reviewed-by: Simon Hausmann Reviewed-by: Alessandro Portale Reviewed-by: Allan Sandfeld Jensen --- .../fontdatabases/windows/qwindowsfontenginedirectwrite.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp index 6130107cc85..683b7f65ada 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp @@ -663,7 +663,7 @@ QImage QWindowsFontEngineDirectWrite::imageForGlyph(glyph_t t, glyphRun.glyphOffsets = &glyphOffset; QTransform xform = originalTransform; - if (fontDef.stretch != 100) + if (fontDef.stretch != 100 && fontDef.stretch != QFont::AnyStretch) xform.scale(fontDef.stretch / 100.0, 1.0); DWRITE_MATRIX transform; @@ -933,7 +933,7 @@ glyph_metrics_t QWindowsFontEngineDirectWrite::alphaMapBoundingBox(glyph_t glyph Q_UNUSED(format); QTransform matrix = originalTransform; - if (fontDef.stretch != 100) + if (fontDef.stretch != 100 && fontDef.stretch != QFont::AnyStretch) matrix.scale(fontDef.stretch / 100.0, 1.0); glyph_metrics_t bbox = QFontEngine::boundingBox(glyph, matrix); // To get transformed advance