Can provide split lines or positions for each character.
```rust use ttfparser::Face; use ttfword_wrap::{TTFParserMeasure, WhiteSpaceWordWrap, Wrap};
// Load a TrueType font using ttf_parser
let fontdata = std::fs::read("./testfonts/Roboto-Regular.ttf").expect("TTF should exist");
let fontface = Face::fromslice(&fontdata, 0).expect("TTF should be valid");
let measure = TTFParserMeasure::new(&fontface);
// Set up wrapping options, split on whitespace: let word_wrap = WhiteSpaceWordWrap::new(20000, &measure);
// Use the Wrap
trait and split the &str
let poem = "Mary had a little lamb whose fleece was white as snow";
let lines: Vec<&str> = poem.wrap(&wordwrap).collect();
asserteq!(lines[0], "Mary had a little lamb");
```
```rust use ttfparser::Face; use ttfword_wrap::{WrapWithPosition, WhiteSpaceWordWrap, TTFParserMeasure, CharPosition, Position};
// Load a TrueType font using ttf_parser
let fontdata = std::fs::read("./testfonts/Roboto-Regular.ttf").expect("TTF should exist");
let fontface = Face::fromslice(&fontdata, 0).expect("TTF should be valid");
let measure = TTFParserMeasure::new(&fontface);
// Set up wrapping options, split on whitespace: let word_wrap = WhiteSpaceWordWrap::new(20000, &measure);
// Use the Wrap
trait and split the &str
let poem = "Mary had a little lamb whose fleece was white as snow";
let positions: Vec
// offset is in the unit (em) of the TTFParserMeasure.
// If the font does not have the given char, CharPosition::Unknown('M')
is returned.
assert!(matches!(positions[0], CharPosition::Known(Position { ch: 'M', line: 0, offset: 0 })));
```