Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.12.5
-
None
-
windows7x64 mingw64-7.3 Qt5.12.5
Description
I have used Process Monitor to trace access to Registry.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes]
Qt makes substitution to "MS Shell Dlg 2" already somewhere inside
for all "non-standard fonts" i.e. not Arial, Times New Roman etc
and tries to find substitution for "MS Shell Dlg 2".
For standard fonts it does everything right.
For example I want to ask for "Arial Greek" and expect to get "Arial".
Code
#include <QGuiApplication> #include <QFontInfo> #include <QDebug> QString family(QString name) { auto font = QFont(name); font.setStyleHint(QFont::System); QFontInfo info(font); return info.family(); } int main(int argc, char *argv[]) { QGuiApplication a(argc, argv); qDebug() << family("Helv"); qDebug() << family("Unknown"); qDebug() << family("Arial"); qDebug() << family("Arial Greek"); qDebug() << family("Arial Undefined"); qDebug() << family("Times New Roman"); return 0; }
Output:
19:03:59: Starting C:\report\font_sub\debug\font_sub.exe ... "MS Shell Dlg 2" "MS Shell Dlg 2" "Arial" "MS Shell Dlg 2" "MS Shell Dlg 2" "Times New Roman" 19:03:59: C:/report/font_sub/debug/font_sub.exe exited with code 0
windows 7 x64 mingw64 7.3 Qt 5.12.5
Attachments
Issue Links
- is required for
-
QTBUG-74860 Umbrella task for font selection issues
- In Progress