Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use Chinese in v2.2.0 #3056

Closed
NotAzay opened this issue Jun 10, 2022 · 2 comments
Closed

Can't use Chinese in v2.2.0 #3056

NotAzay opened this issue Jun 10, 2022 · 2 comments
Labels
blocker Items that would block a forthcoming release bug Something isn't working

Comments

@NotAzay
Copy link

NotAzay commented Jun 10, 2022

Describe the bug:

Can't use Chinese in v2.2.0

To Reproduce:

Just switch the version.

Screenshots:

V2.2.0:
2-2

V2.1.4:
2-1-4

Example code:

package main

import (
	"os"
	"strings"

	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/container"
	"fyne.io/fyne/v2/layout"
	"fyne.io/fyne/v2/widget"

	"github.com/flopp/go-findfont"
)

func init() {
	//设置中文环境
	fontPaths := findfont.List()
	for _, path := range fontPaths {
		// fmt.Println(path)
		//楷体:simkai.ttf
		//黑体:simhei.ttf
		if strings.Contains(path, "simkai.ttf") {
			os.Setenv("FYNE_FONT", path)
			break
		}
	}
}

func main() {
	mainGUI := app.New()
	mainWindow := mainGUI.NewWindow("中文测试")
	testLabel1 := widget.NewLabel("一二三四五,上山打老虎")
	testLabel2 := widget.NewLabel("老虎打不到,打到小松鼠")
	testContainer := container.New(layout.NewVBoxLayout(), testLabel1, testLabel2)
	mainWindow.SetContent(testContainer)
	mainWindow.ShowAndRun()
}

Device (please complete the following information):

  • OS: Win10 Professional Edition
  • Version:
  • Go version: 1.18.3
  • Fyne version: 2.2.0
@NotAzay NotAzay added the unverified A bug that has been reported but not verified label Jun 10, 2022
@andydotxyz andydotxyz added bug Something isn't working blocker Items that would block a forthcoming release and removed unverified A bug that has been reported but not verified labels Jun 10, 2022
@andydotxyz andydotxyz added this to the Fixes (v2.2.x) milestone Jun 10, 2022
@andydotxyz
Copy link
Member

andydotxyz commented Jun 10, 2022

Confirmed. This is a regression.
The functionality is still there, as setting FYNE_FONT on the environment before launch works OK.
Need to look into how/why this changed and whether we want to support this going forward.

Of note is that setting up a custom theme with this font will work, that is a more robust approach as well https://developer.fyne.io/extend/custom-theme.

andydotxyz added a commit to andydotxyz/fyne that referenced this issue Jun 10, 2022
@andydotxyz andydotxyz mentioned this issue Jun 10, 2022
3 tasks
@andydotxyz
Copy link
Member

Fixed for v2.2.1 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Items that would block a forthcoming release bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants