ftui-text 0.4.0

Text layout, wrapping, and grapheme width for FrankenTUI.
Documentation
1
2
3
4
5
6
7
8
9
use ftui_text::wrap::{WrapOptions, wrap_with_options};

#[test]
fn test_wrap_spaces() {
    let text = "Hello  world";
    let opts = WrapOptions::new(6).preserve_indent(false);
    let wrapped = wrap_with_options(text, &opts);
    assert_eq!(wrapped, vec!["Hello", "world"]);
}