stringWidth function
Calculates the display width of a string, accounting for wide characters.
This is useful for terminal rendering where some characters (like CJK) take up two columns.
Implementation
int stringWidth(String s) {
var width = 0;
for (final g in uni.graphemes(s)) {
width += runeWidth(uni.firstCodePoint(g));
}
return width;
}