Skip to content

Conversation

h6ah4i
Copy link

@h6ah4i h6ah4i commented Oct 14, 2025

The Fyne framework does not support TTC font files. Use the default system font (Segoe UI) instead, so Windows can automatically fall back to a Japanese font when needed.

Describe your changes

Stop specifying Yugothm.ttc for Japanese locale.

The same fix has been introduced to v0.39.1 for Chinese locale; A-Archives-and-Forks@4508c61

Issue ticket number and link

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

This is a screenshot for verifying automatic Japanese font fall back is working.

スクリーンショット 2025-10-14 193436

Crash log:

2025/10/14 19:13:30 Fyne error:  font load error
2025/10/14 19:13:30   Cause: collections not allowed
2025/10/14 19:13:30   At: C:/Users/******/go/pkg/mod/fyne.io/fyne/[email protected]/internal/painter/font.go:197
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x7ff73b389344]

goroutine 1 [running, locked to thread]:
fyne.io/fyne/v2/internal/painter.(*dynamicFontMap).ResolveFace(0xc003ce27e0, 0x20)
        C:/Users/******/go/pkg/mod/fyne.io/fyne/[email protected]/internal/painter/font.go:362 +0x64
fyne.io/fyne/v2/internal/painter.walkString({0x7ff73c761840, 0xc003ce27e0}, {0xc000202f04?, 0x0?}, 0x380, {0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...)
        C:/Users/******/go/pkg/mod/fyne.io/fyne/[email protected]/internal/painter/font.go:256 +0xb9
fyne.io/fyne/v2/internal/painter.MeasureString({0x7ff73c761840?, 0xc003ce27e0?}, {0xc000202f04?, 0x0?}, 0x0?, {0x0, 0x0, 0x0, 0x0, 0x0, ...})
        C:/Users/******/go/pkg/mod/fyne.io/fyne/[email protected]/internal/painter/font.go:207 +0x6e
fyne.io/fyne/v2/internal/painter.measureText({0xc000202f04, 0x0}, 0x41600000, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, {0x0, ...})
        C:/Users/******/go/pkg/mod/fyne.io/fyne/[email protected]/internal/painter/font.go:233 +0xa5
fyne.io/fyne/v2/internal/painter.RenderedTextSize({0xc000202f04, 0x0}, 0x41600000, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, {0x0, ...})
        C:/Users/******/go/pkg/mod/fyne.io/fyne/[email protected]/internal/painter/font.go:218 +0xf8
fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).RenderedTextSize(0x0?, {0xc000202f04?, 0x7ff73b3b69ae?}, 0x3c58f162?, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, ...)
        C:/Users/******/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/glfw/driver.go:72 +0x7f
fyne.io/fyne/v2.MeasureText({0xc000202f04, 0x0}, 0x41600000, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0})
        C:/Users/******/go/pkg/mod/fyne.io/fyne/[email protected]/text.go:72 +0x98
fyne.io/fyne/v2/widget.(*RichText).updateRowBounds.func1({0xc000205be0?, 0x7ff73c5a51e9?, 0x0?})
        C:/Users/******/go/pkg/mod/fyne.io/fyne/[email protected]/widget/richtext.go:481 +0x892
fyne.io/fyne/v2/widget.(*RichText).updateRowBounds(0xc00036ed38)
        C:/Users/******/go/pkg/mod/fyne.io/fyne/[email protected]/widget/richtext.go:495 +0x1f0
fyne.io/fyne/v2/widget.(*entryRenderer).Refresh(0xc000210640)
        C:/Users/******/go/pkg/mod/fyne.io/fyne/[email protected]/widget/entry.go:1811 +0xcf
fyne.io/fyne/v2/widget.(*BaseWidget).Refresh(0xc00036ec08)
        C:/Users/******/go/pkg/mod/fyne.io/fyne/[email protected]/widget/widget.go:137 +0x9d
fyne.io/fyne/v2/widget.(*Entry).Refresh(0xc00036ec08)
        C:/Users/******/go/pkg/mod/fyne.io/fyne/[email protected]/widget/entry.go:488 +0x52
fyne.io/fyne/v2/widget.(*DisableableWidget).Disable(0xc00036ec08?)
        C:/Users/******/go/pkg/mod/fyne.io/fyne/[email protected]/widget/widget.go:207 +0x4e
fyne.io/fyne/v2/widget.(*Entry).Disable(...)
        C:/Users/******/go/pkg/mod/fyne.io/fyne/[email protected]/widget/entry.go:225
main.(*serviceClient).showSettingsUI(0xc00045e708)
        C:/Users/******/git/netbird/client/ui/client_ui.go:414 +0x225
main.newServiceClient(0xc000237ee0)
        C:/Users/******/git/netbird/client/ui/client_ui.go:342 +0x23d
main.main()
        C:/Users/******/git/netbird/client/ui/client_ui.go:88 +0x250
2025-10-14T19:13:30+09:00 INFO client/ui/event_handler.go:228: command 'settings true' failed with exit code 2

…ocale (netbirdio#4455)

The Fyne framework does not support TTC font files.
Use the default system font (Segoe UI) instead, so Windows can
automatically fall back to a Japanese font when needed.
@Copilot Copilot AI review requested due to automatic review settings October 14, 2025 10:50
@CLAassistant
Copy link

CLAassistant commented Oct 14, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue where the Advanced Settings dialog would not open on Windows systems with Japanese locale due to the Fyne framework's incompatibility with TTC font files. The fix removes the explicit Japanese font specification to allow Windows to automatically fall back to appropriate fonts.

  • Removes the explicit "Yugothm.ttc" font specification for Japanese locale ("ja-JP")
  • Allows Windows to use the default system font (Segoe UI) and automatically fall back to Japanese fonts when needed
  • Aligns with a similar fix previously applied for Chinese locale in v0.39.1

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

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