core
core copied to clipboard
Chinese fonts cannot be vertically centered when used alone. (whether default or manually set).
Describe the bug
How to reproduce
- Create the simplest program.
- Create three buttons, one displaying in Chinese, one in English, and one displaying in a mix of Chinese and English.
- Observe the text positions.
Example code
package main
import (
"cogentcore.org/core/core"
"cogentcore.org/core/gpu"
"cogentcore.org/core/styles"
"cogentcore.org/core/text/text"
)
func main() {
gpu.SelectAdapter = 0
b := core.NewBody()
core.NewButton(b).SetText("Hello, World!").Styler(func(s *styles.Style) {
s.Text.Align = text.Center
s.Text.AlignV = text.Center
})
core.NewButton(b).SetText("你好世界").Styler(func(s *styles.Style) {
s.Text.Align = text.Center
s.Text.AlignV = text.Center
})
core.NewButton(b).SetText("Hello世界").Styler(func(s *styles.Style) {
s.Text.Align = text.Center
s.Text.AlignV = text.Center
})
b.RunMainWindow()
}
Relevant output
Platform
Windows
Thank you for reporting this. I can reproduce this and we will work on fixing this soon.