pub struct TextLayout { /* private fields */ }Expand description
Shaped text, ready to be broken into lines at any width and drawn.
Implementations§
Source§impl TextLayout
impl TextLayout
Sourcepub fn measure(&mut self, max_width: Option<f32>) -> Size
pub fn measure(&mut self, max_width: Option<f32>) -> Size
Breaks lines at max_width (or never, for None) and returns the text’s size.
Sourcepub fn lines(&self) -> Vec<TextLine>
pub fn lines(&self) -> Vec<TextLine>
The lines of the last Self::measure, with their text ranges and
positions (documents and PDF export draw text line by line).
Sourcepub fn glyphs(&self) -> Vec<ShapedGlyph>
pub fn glyphs(&self) -> Vec<ShapedGlyph>
The glyphs of the last Self::measure in visual order, with the text
each one stands for (document exporters embed glyphs, not characters).
Trait Implementations§
Source§impl Clone for TextLayout
impl Clone for TextLayout
Source§fn clone(&self) -> TextLayout
fn clone(&self) -> TextLayout
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 !RefUnwindSafe for TextLayout
impl !UnwindSafe for TextLayout
impl Freeze for TextLayout
impl Send for TextLayout
impl Sync for TextLayout
impl Unpin for TextLayout
impl UnsafeUnpin for TextLayout
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