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 <simon.hausmann@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2016-12-08 12:31:58 +01:00 committed by Jani Heikkinen
parent 84ea00d470
commit c483945cf4

View File

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