~eliasnaur/gio#211: 
Not render Chinese characters correctly

// ui.input == component.TextField{}
ui.input.SingleLine = true
ui.input.Alignment = layout.Start
return ui.input.Layout(gtx, ui.th, "计时周期(单位:分钟)")

use the code above, the window shows something like ‘□□□□’

didn't find a way to solve this

thanks advance:)

Status
REPORTED
Submitter
~zqk
Assigned to
No-one
Submitted
10 days ago
Updated
10 days ago
Labels
No labels applied.

~eliasnaur 10 days ago

On Fri Apr 2, 2021 at 04:55 CEST, ~zqk wrote:

// ui.input == component.TextField{}
ui.input.SingleLine = true
ui.input.Alignment = layout.Start
return ui.input.Layout(gtx, ui.th, "计时周期(单位:分钟)")

use the code above, the window shows something like ‘□□□□’

didn't find a way to solve this

thanks advance:)

To my understanding the default Gio font, the Go font, doesn't support Chinese characters.

I suggest using a font that does, for example a font from the Noto family.

See [0] for an example of using a non-default font.

Elias

[0] https://github.com/tailscale/tailscale-android/blob/db13aa4e92cca966242bc84ad138b34fff29a493/cmd/tailscale/ui.go#L171

Register here or Log in to comment, or comment via email.