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.
Only counts non-empty visual lines (matching old relevant_layouts behavior).
Sourcepub fn relevant_layout_count(&self) -> usize
pub fn relevant_layout_count(&self) -> usize
Count of visual lines that contain non-whitespace content. Parley’s whitespace-only lines are always trailing, so we scan backwards to find the last visible line rather than filtering all lines.
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(&self) -> impl Iterator<Item = usize>
pub fn start_layout_cols(&self) -> impl Iterator<Item = usize>
Iterator over only the start columns of the relevant layouts.
Cheaper than layout_cols — skips the end-column adjustment that
involves phantom-text resolution, rope lookups and slice comparisons.
Sourcepub fn get_layout_y(&self, nth: usize) -> Option<f32>
pub fn get_layout_y(&self, nth: usize) -> Option<f32>
Get the baseline y position of the given visual 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 UnsafeUnpin 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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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