Wrong default GUI font under Windows
Like any well-behaved GUI application, MuseScore attempts to use the operating system's default GUI font for its user interface, but also allows the user to customize this font according to his or her personal preferences.
MuseScore is a cross-platform application and uses the Qt framework to do most of the heavy lifting, including querying the operating system for the default GUI font. Unfortunately, under Windows, all versions of Qt (past and present) supply the wrong font to MuseScore.
The reason Qt gets it wrong is that internally, it calls the deprecated function
GetStockObject() with the
DEFAULT_GUI_FONT was vestigial and obsolete even in 2005; in fact, the official documentation explicitly says so:
> It is not recommended that you employ this method to obtain the current font used by dialogs and windows.
When this function is called, it returns the “MS Shell Dlg 2” font in 8 pt. Interestingly, “MS Shell Dlg 2” is not an actual font, but rather a virtual placeholder font that is mapped to a real font called Tahoma under all supported versions of Windows. Consequently, the entire MuseScore UI is rendered in Tahoma, which has a dated design that is strongly associated with the Windows Me and Windows XP era of the early 2000s.
In 2006, with the release of Windows Vista, Microsoft introduced a new default GUI font called Segoe UI, as well as a new default size, 9 pt. For backward-compatibility reasons, Microsoft chose not to update the mapping of the “MS Shell Dlg 2” virtual placeholder font or even the implementation of
GetStockObject(). Instead, they quietly deprecated both and introduced a new way to correctly determine the default GUI font: the
SystemParametersInfo() function with the
SPI_GETNONCLIENTMETRICS argument. Not everybody noticed (coughQtcough).
On all versions of Windows from Windows Vista through Windows 10, the new method typically returns the Segoe UI font in 9 pt. Segoe UI has a more contemporary humanist design, and it has had several visual updates over the years. It helps provide a uniform look for all Windows GUI applications, and it also renders significantly better than Tahoma on high-DPI displays.
The Qt developers are now aware of this long-standing problem and have scheduled it to be fixed in Qt 6. (See QTBUG-58610 for details.) The implementation for this fix already exists in the current Qt 5.x source code but has been conditionally compiled out for the time being. Here's a relevant comment taken directly from the Qt source code:
// Qt 5 by (Qt 4) legacy uses GetStockObject(DEFAULT_GUI_FONT) to
// obtain the default GUI font (typically "MS Shell Dlg 2, 8pt"). This has been
// long deprecated; the message font of the NONCLIENTMETRICS structure obtained by
// SystemParametersInfo(SPI_GETNONCLIENTMETRICS) should be used instead (see
// QWindowsTheme::refreshFonts(), typically "Segoe UI, 9pt"), which is larger.
Fortunately, MuseScore users do not have to wait for this fix, because it can be fixed on the application side today.
There are two parts to this fix:
Override Qt's detection of the default GUI font with the correct method. This code will be functionally equivalent to the code already written for Qt 6, and will be implemented as a single block so that it can easily be removed in the future should MuseScore move to Qt 6.
Detect existing settings files that have been saved with the incorrect default GUI font, and reset the incorrect font settings so that the correct font can be picked up automatically by existing MuseScore installations. Note that this will have the side effect of making the “MS Shell Dlg 2” font no longer “stick” if the user explicitly selects it. However, this is a virtual placeholder font that shouldn't be explicitly selected anyway, and any users who prefer its look can always explicitly select the actual underlying font, Tahoma.
Side note: There has been some talk of switching from the default GUI font to a custom font in an upcoming big MuseScore visual redesign. If and when this happens, this fix will become largely moot, but it will also be harmless. In the meantime, this bug should still be fixed right away so that users can get the correct font today.