wxStyledTextCtrl StyleGetFont/StyleSetFont fails on Chinese Windows due to localized vs. English font name mismatch (Issue #25879)

11 views
Skip to first unread message

ibulis1864

unread,
Oct 14, 2025, 10:43:47 AM (3 days ago) Oct 14
to wx-...@googlegroups.com, Subscribed
ibulis1864 created an issue (wxWidgets/wxWidgets#25879)

Bug description:

This issue is related to wxFont and wxStyledTextCtrl (wxSTC), specifically concerning how font names are handled on Windows Chinese systems.

On Windows Chinese systems, a font typically has both its standard English name (e.g., "STLiti") and a localized Chinese display name (e.g., "隶体").

wxFont's GetFaceName() and SetFaceName() methods use the localized display name (e.g., "隶体").

wxSTC's API, which is based on Scintilla, uses the English name (e.g., "STLiti") for style definitions.

Expected vs observed behaviour:

Observed Behaviour (The Problem):

Using wxSTC::StyleGetFont() often results in an incorrect wxFont object. This is because internally, it calls StyleGetFaceName() to get the English name, and then attempts to construct a wxFont object using this English name via wxFont::SetFaceName(). Since wxFont expects the localized display name, using the English name often fails to construct a valid font
Reply all
Reply to author
Forward
0 new messages