Query UI font from system on Windows#6777
Conversation
Previously, we determined the UI font from a predefined set of fonts each mapped to a language. This works well if the user doesn't change their Windows UI font, but if one does, they will get the default UI font associated with their language instead of the one the set. This commit replaces ProgSettings::getFontName with ProgSettings::getUIFont, which uses the SystemParametersInfo API to query the message font from the system, which will allow users to have a custom font. It will also not interfere with different languages, as the message font will be appropriately set by default there.
|
And it also uses ugly fonts for both variants of Chinese as well, while Korean is somehow better. |
|
Here's the tool I am using to view and change the font, BTW. So you can check for yourself. https://gitlab.com/ftortoriello/WinClassicThemeConfig |
|
It will use Yu Gothic UI on a Japanese system, but fall back to MS Gothic on English systems when using the Japanese locale because the message font will not be set accordingly. This isn't a particularly rare pattern. As a matter of fact, I don't think other Japanese fonts are installed on non-Japanese systems, as Japanese text always renders in MS Gothic in web browsers for me on my pure-English installations, and only uses other fonts when I install the Japanese language pack or install Japanese-language versions of Windows. |
Oh, true. I hadn't considered that this person might be using 86Box in Japanese on an English system. But yes, with the proper Windows language packs installed, it should use the correct font for the language just fine, given the rest of the OS will be using it too. |
|
I'm quite sure I have the other Japanese fonts installed on my systems, in fact, I see Meiryo UI installed in Fonts, as is Yu Gothic UI, so the fonts are there, but some reason, Windows is defaulting to MS Gothic. |
|
By the way, I feel that this is a better change, because I use Windows in Japanese with ClearType disabled and MS UI Gothic preferred as the message font. I will build this and test it on a clean Japanese-language installation to see. |
Could you use the utility I linked and check the font that "Message Box" is set to? It's probably a misconfiguration on your end... |
|
It's most likely set to Segoe UI, given that I have my Windows language set to Portuguese (Portugal). |
|
Also, your utility under executable files lists Windows 10 as the latest, I use Windows 11. |
Doesn't matter. It will work regardless. |
|
Just committed a workaround for these specific situations. |
No, this is bad. Now anyone using those languages will be forced onto those fonts. IMO, it's better to have no workaround. Using 86Box in an East Asian language on a system that isn't also using that language globally is such a weird edge case that I believe it's fine to leave how it is. |
They will only be forced if they use an East Asian language in 86Box but not for the OS itself, ie. in the weird edge case. |
|
Sorry, I misread. |






Summary
Previously, we determined the UI font from a predefined set of fonts each mapped to a language. This works well if the user doesn't change their Windows UI font, but if one does, they will get the default UI font associated with their language instead of the one the set.
This commit replaces ProgSettings::getFontName with ProgSettings::getUIFont, which uses the SystemParametersInfo API to query the message font from the system, which will allow users to have a custom font. It will also not interfere with different languages, as the message font will be appropriately set by default there.
Before the patch:

After the patch:

Also confirmed to work on hi-DPI:

Checklist