Fix color fonts with DirectWrite backend

The logic to detect color fonts in the GDI font database was never
implemented in the DirectWrite database, causing emojis to look
monochrome. The patch moves this into the font engine itself instead,
along with the other initialization code.

Pick-to: 6.7
Fixes: QTBUG-122168
Change-Id: I6f5dad579bd987149e613b8071821aaf70a89bc2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
bb10
Eskil Abrahamsen Blomfeldt 2024-02-26 09:29:00 +01:00
parent 3379fd2322
commit 6bd85d4a27
2 changed files with 4 additions and 3 deletions

View File

@ -1257,9 +1257,6 @@ QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request, const Q
QFontDef fontDef = request;
fontDef.families = QStringList(QString::fromWCharArray(n));
if (isColorFont)
fedw->glyphFormat = QFontEngine::Format_ARGB;
fedw->initFontInfo(fontDef, dpi);
fe = fedw;
}

View File

@ -1033,6 +1033,10 @@ void QWindowsFontEngineDirectWrite::initFontInfo(const QFontDef &request,
names->Release();
}
// Color font
if (face3->GetPaletteEntryCount() > 0)
glyphFormat = QFontEngine::Format_ARGB;
face3->Release();
}
#endif