Skip to content

Query UI font from system on Windows#6777

Merged
OBattler merged 1 commit into
86Box:masterfrom
aubymori:master
Feb 3, 2026
Merged

Query UI font from system on Windows#6777
OBattler merged 1 commit into
86Box:masterfrom
aubymori:master

Conversation

@aubymori

@aubymori aubymori commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

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:
image

After the patch:
image

Also confirmed to work on hi-DPI:
image

Checklist

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.
@OBattler OBattler merged commit 4ff39f3 into 86Box:master Feb 3, 2026
44 checks passed
@OBattler

OBattler commented Feb 3, 2026

Copy link
Copy Markdown
Member
imagem

Now it uses MS Gothic for Japanese, which is absolutely ugly.

@OBattler

OBattler commented Feb 3, 2026

Copy link
Copy Markdown
Member

And it also uses ugly fonts for both variants of Chinese as well, while Korean is somehow better.

@aubymori

aubymori commented Feb 3, 2026

Copy link
Copy Markdown
Contributor Author
imagem

Now it uses MS Gothic for Japanese, which is absolutely ugly.

Seems to be using Yu Gothic UI for me after installing Japanese language pack.

image

I can also confirm that the message font is indeed set to that:

image

@aubymori

aubymori commented Feb 3, 2026

Copy link
Copy Markdown
Contributor Author

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

@kawapure

kawapure commented Feb 3, 2026

Copy link
Copy Markdown

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.

@aubymori

aubymori commented Feb 3, 2026

Copy link
Copy Markdown
Contributor Author

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.

@OBattler

OBattler commented Feb 3, 2026

Copy link
Copy Markdown
Member

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.

@kawapure

kawapure commented Feb 3, 2026

Copy link
Copy Markdown

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.

@aubymori

aubymori commented Feb 3, 2026

Copy link
Copy Markdown
Contributor Author

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 defualting to MS Ghotic.

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...

@OBattler

OBattler commented Feb 3, 2026

Copy link
Copy Markdown
Member

It's most likely set to Segoe UI, given that I have my Windows language set to Portuguese (Portugal).

@OBattler

OBattler commented Feb 3, 2026

Copy link
Copy Markdown
Member

Also, your utility under executable files lists Windows 10 as the latest, I use Windows 11.

@aubymori

aubymori commented Feb 3, 2026

Copy link
Copy Markdown
Contributor Author

Also, your utility under executable files lists Windows 10 as the latest, I use Windows 11.

Doesn't matter. It will work regardless.

@kawapure

kawapure commented Feb 3, 2026

Copy link
Copy Markdown

Clean Japanese Windows 10 install versus my XP theme. I think it chooses the font well.

image

@OBattler

OBattler commented Feb 3, 2026

Copy link
Copy Markdown
Member
imagem

Segoe UI confirmed.

@OBattler

OBattler commented Feb 3, 2026

Copy link
Copy Markdown
Member

Just committed a workaround for these specific situations.

@aubymori

aubymori commented Feb 3, 2026

Copy link
Copy Markdown
Contributor Author

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.

@OBattler

OBattler commented Feb 3, 2026

Copy link
Copy Markdown
Member

No, this is bad. Now anyone using those languages will be forced onto those fonts.

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.

@aubymori

aubymori commented Feb 3, 2026

Copy link
Copy Markdown
Contributor Author

Sorry, I misread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants