问题

  • fyne默认不支持中文字体显示
  • 一些帖子千篇一律的误导别人,下个第三方go-font库根本解决不了中文乱码问题
  • 网上的一些字体不适合,中文依然乱码

我的mac book解决方案

git@github.com:lusingander/fyne-font-example.gitShangShouJianSongXianXiTi-2.ttffyne bundle ShangShouJianSongXianXiTi-2.ttf >> bundle.gotheme.go -> MyThememain
a := app.New()
a.Settings().SetTheme(&lib.MyTheme{})
  • 到此中文问题得以解决

fyne mac os打包

fyne package -os --helpfyne package -os darwin -name {你的应用程序名称} -icon {你的App icon}{你的应用程序名称}.app钉钉