# width Display width of a string in terminal cells: East Asian Wide/Fullwidth codepoints (CJK ideographs, kana, Hangul, fullwidth forms, wide emoji) count 2, everything else counts 1. Invalid UTF-8 bytes count 1 each. This is the measurement the TUI cell grid itself uses — a wide glyph occupies two cells in every panel, the terminal emulator, and `draw/text*`. Use `width` (not `len`) whenever you center, pad, or truncate text that may contain wide scripts, or the layout will drift. ## Syntax
[width $string]
## Examples
[width "hello"]        # 5
[width "a中b"]         # 4  (1 + 2 + 1)
[width "日本語"]        # 6
[width "café"]         # 4  (combining marks count 1, standalone)
## Returns A number — the total cell width. ## See Also `cells` (per-codepoint byte offsets + widths), `len` (byte count), `pad-left`, `pad-right`, `draw/text-fit`