pub fn width(s: &str) -> u16Expand description
The number of terminal cells s occupies, saturating at u16::MAX.
Wide characters (CJK, most emoji) count as two columns; combining marks
and most control characters count as zero. Span::width and
Line::width are built on this function; reach for it directly to
measure a borrowed &str without constructing either type first.
See width_usize for the unsaturated measurement.
§Examples
use retroglyph_core::text::width;
assert_eq!(width("hello"), 5);
assert_eq!(width("中文"), 4); // each CJK char is 2 columns