Bidi::TextSource
Abstract text source for bidi algorithms. In Crystal, we only implement this for String (UTF-8). This corresponds to Rust's TextSource trait.
Class methods
Get the character at a given byte index, along with its length in bytes. Returns nil if index is out of range or points inside a multi-byte character.
Get an array of (byte_index, char) pairs for each character.
Iterate over characters with their byte indices and lengths. Yields (byte_index, char, char_length) for each character.