Struct wezterm_bidi::BidiContext
source · pub struct BidiContext { /* private fields */ }
Implementations§
source§impl BidiContext
impl BidiContext
pub fn new() -> Self
pub fn base_level(&self) -> Level
sourcepub fn set_reorder_non_spacing_marks(&mut self, reorder: bool)
pub fn set_reorder_non_spacing_marks(&mut self, reorder: bool)
When reorder
is set to true, reordering will apply rule L3 to
non-spacing marks. This is likely more desirable for terminal
based applications than it is for more modern GUI applications
that feed into eg: harfbuzz.
sourcepub fn runs<'a>(&'a self) -> impl Iterator<Item = BidiRun> + 'a
pub fn runs<'a>(&'a self) -> impl Iterator<Item = BidiRun> + 'a
Produces a sequence of BidiRun
structs that represent runs of
text and their direction (and level) across the entire paragraph.
sourcepub fn line_runs(
&self,
line_range: Range<usize>
) -> impl Iterator<Item = BidiRun>
pub fn line_runs( &self, line_range: Range<usize> ) -> impl Iterator<Item = BidiRun>
Given a line_range (a subslice of the current paragraph that represents a single wrapped line), this method resets whitespace levels for the line boundaries, and then returns the set of runs for that line.
pub fn reordered_runs(&self, line_range: Range<usize>) -> Vec<ReorderedRun>
sourcepub fn reorder_line(&self, line_range: Range<usize>) -> (Vec<Level>, Vec<usize>)
pub fn reorder_line(&self, line_range: Range<usize>) -> (Vec<Level>, Vec<usize>)
line_range
indicates a contiguous range of character indices
in the paragraph set via resolve_paragraph
.
This method returns the reordered set of indices for display
purposes.
sourcepub fn resolve_paragraph(
&mut self,
paragraph: &[char],
hint: ParagraphDirectionHint
)
pub fn resolve_paragraph( &mut self, paragraph: &[char], hint: ParagraphDirectionHint )
pub fn set_char_types( &mut self, char_types: &[BidiClass], hint: ParagraphDirectionHint )
Trait Implementations§
source§impl Debug for BidiContext
impl Debug for BidiContext
source§impl Default for BidiContext
impl Default for BidiContext
source§fn default() -> BidiContext
fn default() -> BidiContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for BidiContext
impl Send for BidiContext
impl Sync for BidiContext
impl Unpin for BidiContext
impl UnwindSafe for BidiContext
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more