graphs-tui 0.4.0

Terminal renderer for Mermaid and D2 diagrams - flowcharts, state diagrams, pie charts in Unicode/ASCII
Documentation
1
2
3
4
5
6
7
8
//! Text display width utilities for proper Unicode handling

use unicode_width::UnicodeWidthStr;

/// Return the display width of a string, accounting for CJK double-width characters.
pub fn display_width(s: &str) -> usize {
    UnicodeWidthStr::width(s)
}