[][src]Struct azul_core::app_resources::WordPositions

pub struct WordPositions {
    pub text_layout_options: ResolvedTextLayoutOptions,
    pub word_positions: Vec<LayoutPoint>,
    pub line_breaks: Vec<(WordIndex, LineLength)>,
    pub trailing: f32,
    pub number_of_words: usize,
    pub number_of_lines: usize,
    pub content_size: LayoutSize,
}

Stores the positions of the vertically laid out texts

Fields

text_layout_options: ResolvedTextLayoutOptions

Options like word spacing, character spacing, etc. that were used to layout these glyphs

word_positions: Vec<LayoutPoint>

Stores the positions of words.

line_breaks: Vec<(WordIndex, LineLength)>

Index of the word at which the line breaks + length of line (useful for text selection + horizontal centering)

trailing: f32

Horizontal width of the last line (in pixels), necessary for inline layout later on, so that the next text run can contine where the last text run left off.

Usually, the "trailing" of the current text block is the "leading" of the next text block, to make it seem like two text runs push into each other.

number_of_words: usize

How many words are in the text?

number_of_lines: usize

How many lines (NOTE: virtual lines, meaning line breaks in the layouted text) are there?

content_size: LayoutSize

Horizontal and vertical boundaries of the layouted words.

Note that the vertical extent can be larger than the last words' position, because of trailing negative glyph advances.

Trait Implementations

impl Clone for WordPositions[src]

impl Debug for WordPositions[src]

impl PartialEq<WordPositions> for WordPositions[src]

impl StructuralPartialEq for WordPositions[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.