pub struct FormattedTextLine { /* private fields */ }Expand description
Represents a line of text which has been laid out as part of a block.
Implementations§
Source§impl FormattedTextLine
impl FormattedTextLine
Sourcepub fn iter_glyphs(&self) -> Iter<'_, FormattedGlyph>
pub fn iter_glyphs(&self) -> Iter<'_, FormattedGlyph>
Iterate over the glyphs in this line.
Sourcepub fn as_block(&self) -> FormattedTextBlock
pub fn as_block(&self) -> FormattedTextBlock
Convert this line of text into an individually-renderable block (while maintaining the same vertical offset).
Sourcepub fn height(&self) -> f32
pub fn height(&self) -> f32
The height (in pixels) of this text line. This is equal to the
ascent() minus the descent().
Sourcepub fn ascent(&self) -> f32
pub fn ascent(&self) -> f32
The ascent (in pixels) of this text line. This is the maximum height of each glyph above the text baseline.
Sourcepub fn descent(&self) -> f32
pub fn descent(&self) -> f32
The descent (in pixels) of this text line. This is the furthest distance of each glyph below the text baseline.
This is negative: a value of -10.0 means the font can descend 10
pixels below the baseline.
Sourcepub fn line_gap(&self) -> f32
pub fn line_gap(&self) -> f32
The recommended gap to put between each line of text, as encoded by the font authors.
Sourcepub fn baseline_position(&self) -> f32
pub fn baseline_position(&self) -> f32
The vertical position of this line’s baseline within the block of text.
Trait Implementations§
Source§impl Clone for FormattedTextLine
impl Clone for FormattedTextLine
Source§fn clone(&self) -> FormattedTextLine
fn clone(&self) -> FormattedTextLine
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FormattedTextLine
impl RefUnwindSafe for FormattedTextLine
impl Send for FormattedTextLine
impl Sync for FormattedTextLine
impl Unpin for FormattedTextLine
impl UnwindSafe for FormattedTextLine
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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