Skip to content

FIX: Linux startup crash when using Japanese or Korean - #12082

Merged
lanewei120 merged 3 commits into
bambulab:masterfrom
aoblue2547:fix/wxgtk-font-init
Aug 31, 2026
Merged

FIX: Linux startup crash when using Japanese or Korean#12082
lanewei120 merged 3 commits into
bambulab:masterfrom
aoblue2547:fix/wxgtk-font-init

Conversation

@aoblue2547

Copy link
Copy Markdown
Contributor

Summary

Fix a Linux startup crash when Bambu Studio is configured to use Japanese or Korean.

Root cause

GUI_App is constructed before wxEntry() initializes wxGTK.

The constructor previously called the language-specific Label::initSysFont(). On Linux, only the HarmonyOS fonts were registered as private fonts. When Japanese or Korean was selected, the requested font could be unavailable, causing
Label::sysFont() to fall back to wxSystemSettings::GetFont().

This fallback may access GtkSettings before GTK initialization, resulting in GLib/GTK critical errors and a startup crash.

Changes

  • Register the bundled Source Han Sans JP and NanumGothic fonts with wxFont::AddPrivateFont() on Linux, alongside the existing HarmonyOS fonts.
  • Defer language-specific Label font initialization from the GUI_App constructor to on_init_inner(), after wxEntry() has initialized wxGTK.
  • Avoid re-registering private fonts when changing the language in Preferences. The fonts are already registered during startup, so only the language-specific Label fonts need to be recreated.

@tonghao-bbl
tonghao-bbl removed the request for review from XinZhangBambu August 31, 2026 00:59
// Reparent(nullptr);
GetParent()->RemoveChild(this);
Label::initSysFont(app_config->get_language_code());
Label::initSysFont(app_config->get_language_code(), false);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why make the last parameter false

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point, the fonts have already been registered in BambuStudio.cpp:1607, so I removed the second call to wxFont::AddPrivateFont().

@aoblue2547
aoblue2547 requested a review from tonghao-bbl August 31, 2026 01:45
@tonghao-bbl

Copy link
Copy Markdown
Contributor

LGTM @lanewei120

@lanewei120
lanewei120 merged commit 66e4054 into bambulab:master Aug 31, 2026
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.

When I set the language to Japanese in Bambu Stadio, it won't launch cachyos linux bambu studio ko_kr no Run

3 participants