pub struct TextLineImpl { /* private fields */ }Expand description
The line produced by the text formatter.
The run list is only written by TextLineImpl::replace_text_run (used
by justification) and by TextLineImpl::finalize_line; everything else
reads it.
Implementations§
Source§impl TextLineImpl
impl TextLineImpl
pub fn new( text_runs: Vec<Rc<dyn TextRun>>, first_text_source_index: i32, length: i32, paragraph_width: f64, paragraph_properties: Rc<dyn TextParagraphProperties>, resolved_flow_direction: FlowDirection, line_break: Option<Rc<TextLineBreak>>, has_collapsed: bool, ) -> Rc<Self>
Sourcepub fn get_baseline_offset(
text_line: &dyn TextLine,
text_run: &dyn DrawableTextRun,
) -> f64
pub fn get_baseline_offset( text_line: &dyn TextLine, text_run: &dyn DrawableTextRun, ) -> f64
The vertical offset that aligns a run in a line according to the run’s baseline alignment.
Panics when the run has no properties (and therefore no baseline alignment).
pub fn finalize_line(&self)
Trait Implementations§
Source§impl TextLine for TextLineImpl
impl TextLine for TextLineImpl
Source§fn get_text_bounds(
&self,
first_text_source_index: i32,
text_length: i32,
) -> Vec<TextBounds>
fn get_text_bounds( &self, first_text_source_index: i32, text_length: i32, ) -> Vec<TextBounds>
Returns no bounds for an empty range.
Source§fn text_runs(&self) -> Ref<'_, [Rc<dyn TextRun>]>
fn text_runs(&self) -> Ref<'_, [Rc<dyn TextRun>]>
Gets the text runs that are contained within a line (visual order).
Source§fn first_text_source_index(&self) -> i32
fn first_text_source_index(&self) -> i32
Gets the first text source index in the line.
Source§fn text_line_break(&self) -> Option<Rc<TextLineBreak>>
fn text_line_break(&self) -> Option<Rc<TextLineBreak>>
Gets the state of the line when broken by line breaking process.
Source§fn has_collapsed(&self) -> bool
fn has_collapsed(&self) -> bool
Gets a value that indicates whether the line is collapsed.
Source§fn has_overflowed(&self) -> bool
fn has_overflowed(&self) -> bool
Gets a value that indicates whether content of the line overflows the
specified paragraph width.
Source§fn baseline(&self) -> f64
fn baseline(&self) -> f64
Gets the distance from the top to the baseline of the current line of text.
Source§fn extent(&self) -> f64
fn extent(&self) -> f64
Gets the distance from the top-most to bottom-most black pixel in a line.
Source§fn new_line_length(&self) -> i32
fn new_line_length(&self) -> i32
Gets the number of newline characters at the end of a line.
Source§fn overhang_after(&self) -> f64
fn overhang_after(&self) -> f64
Gets the distance that black pixels extend beyond the bottom alignment edge of a line.
Source§fn overhang_leading(&self) -> f64
fn overhang_leading(&self) -> f64
Gets the distance that black pixels extend prior to the left leading alignment edge of the line.
Source§fn overhang_trailing(&self) -> f64
fn overhang_trailing(&self) -> f64
Gets the distance that black pixels extend following the right trailing alignment edge of the line.
Source§fn trailing_whitespace_length(&self) -> i32
fn trailing_whitespace_length(&self) -> i32
Gets the number of whitespace code points beyond the last non-blank
character in a line.
Source§fn start(&self) -> f64
fn start(&self) -> f64
Gets the distance from the start of a paragraph to the starting point of a line.
Source§fn width(&self) -> f64
fn width(&self) -> f64
Gets the width of a line of text, excluding trailing whitespace characters.
Source§fn width_including_trailing_whitespace(&self) -> f64
fn width_including_trailing_whitespace(&self) -> f64
Gets the width of a line of text, including trailing whitespace characters.
Source§fn draw(&self, drawing_context: &mut dyn ITextDrawingSink, line_origin: Point)
fn draw(&self, drawing_context: &mut dyn ITextDrawingSink, line_origin: Point)
Draws the text line onto the drawing context at the given origin.
Source§fn collapse(
self: Rc<Self>,
collapsing_properties_list: &[Option<Rc<dyn TextCollapsingProperties>>],
) -> Rc<dyn TextLine>
fn collapse( self: Rc<Self>, collapsing_properties_list: &[Option<Rc<dyn TextCollapsingProperties>>], ) -> Rc<dyn TextLine>
Create a collapsed line based on collapsed text properties. Returns
the line itself when nothing has to be collapsed.
Source§fn justify(&self, justification_properties: &dyn JustificationProperties)
fn justify(&self, justification_properties: &dyn JustificationProperties)
Justifies the line by applying given justification properties.
Source§fn get_character_hit_from_distance(&self, distance: f64) -> CharacterHit
fn get_character_hit_from_distance(&self, distance: f64) -> CharacterHit
Gets the character hit corresponding to the specified distance from
the beginning of the line.
Source§fn get_distance_from_character_hit(&self, character_hit: CharacterHit) -> f64
fn get_distance_from_character_hit(&self, character_hit: CharacterHit) -> f64
Gets the distance from the beginning of the line to the specified character hit.
Source§fn get_next_caret_character_hit(
&self,
character_hit: CharacterHit,
) -> CharacterHit
fn get_next_caret_character_hit( &self, character_hit: CharacterHit, ) -> CharacterHit
Gets the next character hit for caret navigation.
Source§fn get_previous_caret_character_hit(
&self,
character_hit: CharacterHit,
) -> CharacterHit
fn get_previous_caret_character_hit( &self, character_hit: CharacterHit, ) -> CharacterHit
Gets the previous character hit for caret navigation.
Source§fn get_backspace_caret_character_hit(
&self,
character_hit: CharacterHit,
) -> CharacterHit
fn get_backspace_caret_character_hit( &self, character_hit: CharacterHit, ) -> CharacterHit
Gets the previous character hit after backspacing.
Auto Trait Implementations§
impl !Freeze for TextLineImpl
impl !RefUnwindSafe for TextLineImpl
impl !Send for TextLineImpl
impl !Sync for TextLineImpl
impl !UnwindSafe for TextLineImpl
impl Unpin for TextLineImpl
impl UnsafeUnpin for TextLineImpl
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more