FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    TextLine

    trait · ferroui-base · v0.5.0

    trait TextLine: 'static
    

    Represents a line of text that is used for text rendering.

    All character indices and lengths are UTF-16 code units in text source coordinates.

    View source

    Members

    text_runs

    fn text_runs(self: &Self) -> Ref<'_, [Rc<dyn TextRun>]>
    

    Gets the text runs that are contained within a line (visual order).

    Source

    first_text_source_index

    fn first_text_source_index(self: &Self) -> i32
    

    Gets the first text source index in the line.

    Source

    length

    fn length(self: &Self) -> i32
    

    Gets the total number of text source positions of the line.

    Source

    text_line_break

    fn text_line_break(self: &Self) -> Option<Rc<TextLineBreak>>
    

    Gets the state of the line when broken by line breaking process.

    Source

    baseline

    fn baseline(self: &Self) -> f64
    

    Gets the distance from the top to the baseline of the current line of text.

    Source

    extent

    fn extent(self: &Self) -> f64
    

    Gets the distance from the top-most to bottom-most black pixel in a line.

    Source

    has_collapsed

    fn has_collapsed(self: &Self) -> bool
    

    Gets a value that indicates whether the line is collapsed.

    Source

    has_overflowed

    fn has_overflowed(self: &Self) -> bool
    

    Gets a value that indicates whether content of the line overflows the specified paragraph width.

    Source

    height

    fn height(self: &Self) -> f64
    

    Gets the height of a line of text.

    Source

    new_line_length

    fn new_line_length(self: &Self) -> i32
    

    Gets the number of newline characters at the end of a line.

    Source

    overhang_after

    fn overhang_after(self: &Self) -> f64
    

    Gets the distance that black pixels extend beyond the bottom alignment edge of a line.

    Source

    overhang_leading

    fn overhang_leading(self: &Self) -> f64
    

    Gets the distance that black pixels extend prior to the left leading alignment edge of the line.

    Source

    overhang_trailing

    fn overhang_trailing(self: &Self) -> f64
    

    Gets the distance that black pixels extend following the right trailing alignment edge of the line.

    Source

    start

    fn start(self: &Self) -> f64
    

    Gets the distance from the start of a paragraph to the starting point of a line.

    Source

    trailing_whitespace_length

    fn trailing_whitespace_length(self: &Self) -> i32
    

    Gets the number of whitespace code points beyond the last non-blank character in a line.

    Source

    width

    fn width(self: &Self) -> f64
    

    Gets the width of a line of text, excluding trailing whitespace characters.

    Source

    width_including_trailing_whitespace

    fn width_including_trailing_whitespace(self: &Self) -> f64
    

    Gets the width of a line of text, including trailing whitespace characters.

    Source

    draw

    fn draw(self: &Self, drawing_context: &mut dyn ITextDrawingSink, line_origin: Point)
    

    Draws the text line onto the drawing context at the given origin.

    Source

    collapse

    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

    justify

    fn justify(self: &Self, justification_properties: &dyn JustificationProperties)
    

    Justifies the line by applying given justification properties.

    Source

    get_character_hit_from_distance

    fn get_character_hit_from_distance(self: &Self, distance: f64) -> CharacterHit
    

    Gets the character hit corresponding to the specified distance from the beginning of the line.

    Source

    get_distance_from_character_hit

    fn get_distance_from_character_hit(self: &Self, character_hit: CharacterHit) -> f64
    

    Gets the distance from the beginning of the line to the specified character hit.

    Source

    get_next_caret_character_hit

    fn get_next_caret_character_hit(self: &Self, character_hit: CharacterHit) -> CharacterHit
    

    Gets the next character hit for caret navigation.

    Source

    get_previous_caret_character_hit

    fn get_previous_caret_character_hit(self: &Self, character_hit: CharacterHit) -> CharacterHit
    

    Gets the previous character hit for caret navigation.

    Source

    get_backspace_caret_character_hit

    fn get_backspace_caret_character_hit(self: &Self, character_hit: CharacterHit) -> CharacterHit
    

    Gets the previous character hit after backspacing.

    Source

    get_text_bounds

    fn get_text_bounds(self: &Self, first_text_source_character_index: i32, text_length: i32) -> Vec<TextBounds>
    

    Get an array of bounding rectangles of a range of characters within a text line.

    Returns a list of bounding rectangles, or an empty list for an empty range.

    Source

    dispose

    fn dispose(self: &Self)
    

    Releases the resources of the line.

    Source

    as_any

    fn as_any(self: &Self) -> &dyn Any
    

    The line as Any, for downcasting to the concrete line type.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.