Fix DirectWrite engine when loading from data through QRawFont

The stretch, once it is passed to the font engine, is assumed to
be the horizontal scale needed to match the requested stretch
for the given font. When loading from data in QRawFont, there
is no way to specify this stretch; the scale should always be 1.

The effect of this was that when DirectWrite was backing a font
loaded through QRawFont directly from data, then the glyph images
would be scaled to 0xHEIGHT before they were returned, thus
they would be empty.

This was a regression caused by
ec7fee968f.

Task-number: QTBUG-56091
Change-Id: I38e76e0e8f6809262474922946752b2ad0d6209b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2016-09-20 16:29:58 +02:00
parent 9888a2c138
commit 31b3986e2d

View File

@ -1257,6 +1257,7 @@ QT_WARNING_POP
request.pixelSize = pixelSize;
request.styleStrategy = QFont::PreferMatch;
request.hintingPreference = hintingPreference;
request.stretch = QFont::Unstretched;
fontEngine = QWindowsFontDatabase::createEngine(request,
QWindowsContext::instance()->defaultDPI(),