nsf / termbox-go

Pure Go termbox implementation
http://godoc.org/github.com/nsf/termbox-go
MIT License
4.66k stars 372 forks source link

RuneWidth ? #187

Closed GitchB closed 3 years ago

GitchB commented 6 years ago

I notice that there are several places in the code where it adjusts the rune width like this: w := runewidth.RuneWidth(r) if w == 0 || (w == 2 && runewidth.IsAmbiguousWidth(r)) { w = 1 } I'm curious about this. For "normal" Unicode glyphs it doesn't seem to matter -- so it seems that it is necessary in some special cases. Should I also do this adjustment in my code (which imports termbox-go), or can I just use runewidth.RuneWidth?

nsf commented 6 years ago

Unless you use CJK (chinese japanese korean) characters - no. Those characters take two cells in terminals typically.