Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use parent's font for warning text in preferences #194

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

0tkl
Copy link
Contributor

@0tkl 0tkl commented Dec 31, 2023

According to the documentation, wxFONTFAMILY_SWISS = a sans-serif font. However when Windows in zh-CN or zh-TW locales, they're displayed in SimSun(宋体)or PMingLIU(細明體), both are serif and kinda last fallback fonts in their locales. This bug is clearly attributed to wxWidgets attributed to the backward compatibility of Windows. We could patch it on wxWidgets' side, but we may need a workaround for a couple of years considering wx's release cycle.

zh-CN
zh-TW

This patch can be applied to @arch1t3cht's and @wangqr's fork.

@0tkl
Copy link
Contributor Author

0tkl commented Jan 1, 2024

The original code used wxFONTFAMILY_SWISS to set a bold sans-serif font
for the warning message in Preferences/Advanced, assuming that:
1. SWISS always returns a sans-serif font.
2. The system UI font is universally sans-serif across all locales.

However, the first assumption is incorrect, and the second one *was*
incorrect. SWISS may return a serif font on modern Windows systems
under Chinese locales, due to backward compatibility with older Windows
versions where Chinese locales used serif fonts for the UI.

The commit fixes the issue by using the parent's font and making it
bold instead of directly constructing a wxFont with SWISS.
@0tkl 0tkl changed the title No more selecting wxFONTFAMILY_SWISS font by wxWidgets Use parent's font for warning text in preferences Dec 19, 2024
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.

1 participant