pub struct WordPositions {
pub text_layout_options: ResolvedTextLayoutOptions,
pub word_positions: Vec<WordPosition>,
pub line_breaks: Vec<InlineTextLine>,
pub trailing: f32,
pub number_of_shaped_words: usize,
pub number_of_lines: usize,
pub content_size: LogicalSize,
}Expand description
Stores the positions of the vertically laid out texts
Fields§
§text_layout_options: ResolvedTextLayoutOptionsOptions like word spacing, character spacing, etc. that were used to layout these glyphs
word_positions: Vec<WordPosition>Stores the positions of words.
line_breaks: Vec<InlineTextLine>Index of the word at which the line breaks + length of line (useful for text selection + horizontal centering)
trailing: f32Horizontal 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_shaped_words: usizeHow many words are in the text?
number_of_lines: usizeHow many lines (NOTE: virtual lines, meaning line breaks in the layouted text) are there?
content_size: LogicalSizeHorizontal 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§
Source§impl Clone for WordPositions
impl Clone for WordPositions
Source§fn clone(&self) -> WordPositions
fn clone(&self) -> WordPositions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WordPositions
impl Debug for WordPositions
Source§impl PartialEq for WordPositions
impl PartialEq for WordPositions
impl StructuralPartialEq for WordPositions
Auto Trait Implementations§
impl Freeze for WordPositions
impl RefUnwindSafe for WordPositions
impl Send for WordPositions
impl Sync for WordPositions
impl Unpin for WordPositions
impl UnwindSafe for WordPositions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more