Request actual font family request in final color font fail safe
When we're trying to resolve a font for color emojis, we will prefer any color font over the selected font (since a normal font may have monochrome glyphs for emoji characters and that's not what we are after). If there are no color fonts on the system at all, we need to do a final match where we ignore whether the font is in color or not and just return it anyway. In this final pass we would find the first best match among the fallbacks (typically the first one), but never actually check the font that was requested in the first place. This was a mistake. Unless it does not exist, we should just return the requested font family. Pick-to: 6.9 Task-number: QTBUG-132377 Change-Id: Ie53a6bd665ebdaaca92bf0c33fabf5195e1aa5fe Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
parent
a8d8fb83cc
commit
b154af082c
@ -2802,6 +2802,11 @@ QFontEngine *QFontDatabasePrivate::findFont(const QFontDef &req,
|
||||
// and extra pass on the fallbacks for this.
|
||||
if (!engine && script == QFontDatabasePrivate::Script_Emoji) {
|
||||
qCDebug(lcFontMatch, "No color fonts found on system. Doing final fallback match.");
|
||||
|
||||
// Since we no longer require color fonts, we need to retry to check if the
|
||||
// actual requested font is available as a non-color font.
|
||||
if (!requestFamily.isEmpty())
|
||||
fallbacks.prepend(requestFamily);
|
||||
engine = findMatchingFallback(QChar::Script_Common, script);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user