Get client ui locale on windows natively (#2251)

This commit is contained in:
Viktor Liu
2024-07-12 08:25:33 +02:00
committed by GitHub
parent f74646a3ac
commit 89df6e7242
4 changed files with 124 additions and 85 deletions

26
client/ui/font_bsd.go Normal file
View File

@ -0,0 +1,26 @@
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
package main
import (
"os"
"runtime"
log "github.com/sirupsen/logrus"
)
const defaultFontPath = "/Library/Fonts/Arial Unicode.ttf"
func (s *serviceClient) setDefaultFonts() {
// TODO: add other bsd paths
if runtime.GOOS != "darwin" {
return
}
if _, err := os.Stat(defaultFontPath); err != nil {
log.Errorf("Failed to find default font file: %v", err)
return
}
os.Setenv("FYNE_FONT", defaultFontPath)
}