Expand description
Measuring text in terminal cells: width, truncation with an ellipsis at the end or in the middle, and word wrapping.
Constants§
- ELLIPSIS
- The ellipsis drawn where text is cut.
Functions§
- grapheme_
width - Display width of one grapheme cluster.
- truncate
textcut to at mostmaxcells, ending in…when anything was removed.- truncate_
middle textcut to at mostmaxcells by removing its middle, with…where the middle was.- width
- Display width of
textin cells. - wrap
- Splits
textinto lines no wider thanmaxcells. - wrap_
ranges - Like
wrap, but returns byte ranges intotext, so styled text can be wrapped and drawn with its styles.