Struct Bidi Line
pub struct BidiLine<'a> { /* private fields */ }Expand description
Borrowed complete single-line text with resolved base/byte levels and visual runs, using unicode-bidi’s pinned Unicode 16.0 data. No wrapping, script/font segmentation, glyph mirroring/combining reordering, caret or native UI is added. The downstream shaper owns mirroring/marks within each original logical run.
Implementations§
§impl<'a> BidiLine<'a>
impl<'a> BidiLine<'a>
pub fn new(
text: &'a str,
base: Option<TextDirection>,
) -> Result<Self, TextError>
pub fn new( text: &'a str, base: Option<TextDirection>, ) -> Result<Self, TextError>
Resolve <=4096 UTF8 bytes/<=512 visual runs. None selects first-strong base direction (LTR if no strong text); explicit direction overrides it. Controls, line/paragraph separators and noncharacters reject; directional formatting/isolate characters are allowed and retained in source ranges. Backend transient memory/time is not globally bounded; no audio callback.
pub fn text(&self) -> &'a str
pub fn base_direction(&self) -> TextDirection
pub fn byte_levels(&self) -> &[u8]
pub fn byte_levels(&self) -> &[u8]
Embedding level per UTF8 byte; multi-byte characters repeat the same level.