diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2023-03-16 13:28:01 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2023-04-19 15:11:35 +0100 |
commit | 25530c7020df099ed26737ee591bf6c55b3d8a39 (patch) | |
tree | dc3488a76e7c9eb877ca841d3deb7796c2f38233 /src/gui/text/windows | |
parent | 0685b5b9b0a64cea6ddf3b4ec9f3f6d103766654 (diff) |
win: Fix default fallback font for some languages
In Qt 5, the system font would resolve to MS Shell Dlg 2, which
was always an alias for Tahoma. Since it was not a real font,
but a so-called "logical font", it was manually added to the font
database whenever we detected that the system font was not
automatically enumerated.
In Qt 6 we modernized the selection of system font. This causes
real fonts, such as Segoe UI, to be selected as the default and
the manual adding of "MS Shell Dlg 2" to the font database never
happens.
However, "MS Shell Dlg 2" was still preferred as the primary
fallback font, but we now always failed to resolve it because
it wasn't in the font database. For many writing systems not
supported by the main system font, such as e.g. Thai, people
still expect to get Tahoma as the default, but we now return
an arbitrary font from the alphabetically ordered list instead.
To work around this, we avoid returning the non-existing logical
font, since this is no longer useful, and just return Tahoma
directly.
[ChangeLog][QtGui][Text] Fixed an issue querying a default font
for certain languages not supported by the primary system font.
Pick-to: 6.2 6.5
Change-Id: Iacc7a7e7742114efcd82620d0ed099dc4e897fc6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui/text/windows')
-rw-r--r-- | src/gui/text/windows/qwindowsfontdatabasebase.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/windows/qwindowsfontdatabasebase.cpp b/src/gui/text/windows/qwindowsfontdatabasebase.cpp index f45678c65c..f9b36b4852 100644 --- a/src/gui/text/windows/qwindowsfontdatabasebase.cpp +++ b/src/gui/text/windows/qwindowsfontdatabasebase.cpp @@ -802,7 +802,7 @@ QString QWindowsFontDatabaseBase::familyForStyleHint(QFont::StyleHint styleHint) default: break; } - return QStringLiteral("MS Shell Dlg 2"); + return QStringLiteral("Tahoma"); } // Creation functions |