Example #1
0
func printMsgf(term Terminal, x, y int, fg, bg uint16, format string, args ...interface{}) {
	msg := fmt.Sprintf(format, args...)
	for _, c := range msg {
		term.SetCell(x, y, c, fg, bg)
		x += runewidth.RuneWidth(c)
	}
}
Example #2
0
func BenchmarkOtherlib1(b *testing.B) {
	for n := 0; n < b.N; n++ {
		_ = mattn.RuneWidth('コ')
	}
}
Example #3
0
func charWidth(ch rune) int {
	return rw.RuneWidth(ch)
}