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

Merged
merged 1 commit into from
Jan 3, 2025

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

@0tkl 0tkl force-pushed the 0tkl/patch branch 2 times, most recently from 2971d80 to 1c13448 Compare December 19, 2024 09:54
@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
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. On modern Windows under Chinese locales, SWISS will return
SimSun or PMingLiU, which are serif fonts with embedded bitmaps that
are distributed with legacy Windows as the default interface fonts.

The commit fixes the issue by using the parent's font and making
it bold instead of directly constructing a wxFont with SWISS.
@arch1t3cht arch1t3cht merged commit fdac697 into TypesettingTools:master Jan 3, 2025
7 checks passed
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.

2 participants