Details
-
Suggestion
-
Resolution: Won't Do
-
Not Evaluated
-
None
-
5.15.2, 6.1.0
-
None
Description
There are some scenarios when font installed via QFontDatabase::addApplicationFont should not be matched to.
- Font contains non-standard glyphs, so we should never use it unless explicitly specified.
- We are making Character Map replacement, in some places show all possible characters (probably using bundled fonts), and in some places show tofu when system fonts lack some character.
In 5.14.2 AddFontResourceExW with FR_PRIVATE flag did the job (but of course it is non-portable). In 5.15+ it works extremely unreliably: works for NotoNaskhArabic-Regular.ttf and does nothing for NotoSansRunic-Regular.ttf.
Either of three ways works for me.
- Make AddFontResourceExW work again like in 5.14.
- QFontDatabase::addApplicationFont(fileName, QFontDatabase::NoMatchTo)
- QFont::setStyleStrategy(QFont::NoApplicationFonts).