netbird
netbird copied to clipboard
Chinese Font Support
Describe the problem
client latest version (v0.27.4) added the Network Routes Panel, when there is Chinese will display garbled code, this is because Fyne does not support Chinese fonts by default, Fyne's solution to this issue
To Reproduce
Steps to reproduce the behavior:
- Open Web Dashboard
- Open network-routes page
- Add New Route
- Enter the name “测试”
Expected behavior
recommended to use noto fonts (OFL) for commercial licensing reasons.
NetBird version
0.27.4
Screenshots
0.27.4 version
local debug version
Additional context
But I set the FYNE_FONT environment variable before running Netbird UI, which can solve the problem of garbled code, the code is very simple to add the init method (currently the package for internal employees is done this way)
//client_ui.go
func init() {
defaultFontPath := "./fonts/NotoSansSC-Regular.ttf"
font, exists := os.LookupEnv("FYNE_FONT")
if exists {
os.Setenv("FYNE_FONT", font)
} else {
os.Setenv("FYNE_FONT", defaultFontPath)
}
}
Yes it does exist and I'm waiting for it to be fixed
maybe other language should also be support, not only Chinese.
:)
This is bad; thanks for reporting, folks. We will handle it.
This is bad; thanks for reporting, folks. We will handle it.
I think this can be solved without adding font files to the project, by calling the system default font files directly based on the system locale. I can try to solve this problem
@MrChenhtlss I submitted a PR, remember to update it when I wait for the merge to be posted :)