An attempt to fix font stretching with DirectFrite font engine

Do the `lf.lfWidth = tm.tmAveCharWidth * request.stretch / 100` trick
for the DirectWrite path, too.

Task-number: QTBUG-22652
Change-Id: I5238bce1033555a4386cb48fed8c898a9632e0cd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
Konstantin Ritt 2015-02-15 03:09:08 +04:00
parent cd75f29794
commit af1a99ebb9

View File

@ -1693,7 +1693,6 @@ QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request,
LOGFONT lf = fontDefToLOGFONT(request);
const bool preferClearTypeAA = lf.lfQuality == CLEARTYPE_QUALITY;
if (!useDirectWrite) {
if (request.stretch != 100) {
HFONT hfont = CreateFontIndirect(&lf);
if (!hfont) {
@ -1711,10 +1710,9 @@ QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request,
DeleteObject(hfont);
}
}
#if !defined(QT_NO_DIRECTWRITE)
else {
if (useDirectWrite) {
// Default to false for DirectWrite (and re-enable once/if everything turns out okay)
useDirectWrite = false;
if (initDirectWrite(data.data())) {