Skip to main content

TextLayout

Trait TextLayout 

Source
pub trait TextLayout {
    // Required method
    fn layout(
        &mut self,
        text: &str,
        style: &TextStyle,
        max_width: Option<u32>,
    ) -> LaidOut;
}
Expand description

A text layout engine.

Required Methods§

Source

fn layout( &mut self, text: &str, style: &TextStyle, max_width: Option<u32>, ) -> LaidOut

Lays out a text.

§Arguments
  • text - The text to lay out.
  • style - The font, size and style.
  • max_width - The width in pixels at which to wrap, or None for no wrapping.
§Returns

The size, lines, glyph runs and geometry of the text.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§