pub struct TextLayoutLine {
pub extra_style: Vec<LineExtraStyle>,
pub text: TextLayout,
pub whitespaces: Option<Vec<(char, (f64, f64))>>,
pub indent: f64,
pub phantom_text: PhantomTextLine,
}Fields§
§extra_style: Vec<LineExtraStyle>Extra styling that should be applied to the text (x0, x1 or line display end, style)
text: TextLayout§whitespaces: Option<Vec<(char, (f64, f64))>>§indent: f64§phantom_text: PhantomTextLineImplementations§
Source§impl TextLayoutLine
impl TextLayoutLine
Sourcepub fn line_count(&self) -> usize
pub fn line_count(&self) -> usize
The number of line breaks in the text layout. Always at least 1.
Sourcepub fn relevant_layouts(&self) -> impl Iterator<Item = &LayoutLine> + '_
pub fn relevant_layouts(&self) -> impl Iterator<Item = &LayoutLine> + '_
Iterate over all the layouts that are nonempty. Note that this may be empty if the line is completely empty, like the last line
Sourcepub fn layout_cols<'a>(
&'a self,
text_prov: impl TextLayoutProvider + 'a,
line: usize,
) -> impl Iterator<Item = (usize, usize)> + 'a
pub fn layout_cols<'a>( &'a self, text_prov: impl TextLayoutProvider + 'a, line: usize, ) -> impl Iterator<Item = (usize, usize)> + 'a
Iterator over the (start, end) columns of the relevant layouts.
Sourcepub fn start_layout_cols<'a>(
&'a self,
text_prov: impl TextLayoutProvider + 'a,
line: usize,
) -> impl Iterator<Item = usize> + 'a
pub fn start_layout_cols<'a>( &'a self, text_prov: impl TextLayoutProvider + 'a, line: usize, ) -> impl Iterator<Item = usize> + 'a
Iterator over the start columns of the relevant layouts
Sourcepub fn get_layout_y(&self, nth: usize) -> Option<f32>
pub fn get_layout_y(&self, nth: usize) -> Option<f32>
Get the top y position of the given line index
Trait Implementations§
Source§impl Clone for TextLayoutLine
impl Clone for TextLayoutLine
Source§fn clone(&self) -> TextLayoutLine
fn clone(&self) -> TextLayoutLine
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TextLayoutLine
impl RefUnwindSafe for TextLayoutLine
impl Send for TextLayoutLine
impl Sync for TextLayoutLine
impl Unpin for TextLayoutLine
impl UnwindSafe for TextLayoutLine
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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