Struct speedy2d::font::FormattedTextLine
source · 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: &Rc<Self>) -> FormattedTextBlock
pub fn as_block(self: &Rc<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.