[][src]Trait iced_graphics::backend::Text

pub trait Text {
    const ICON_FONT: Font;
    const CHECKMARK_ICON: char;
    const ARROW_DOWN_ICON: char;

    fn default_size(&self) -> u16;
fn measure(
        &self,
        contents: &str,
        size: f32,
        font: Font,
        bounds: Size
    ) -> (f32, f32); }

A graphics backend that supports text rendering.

Associated Constants

const ICON_FONT: Font

The icon font of the backend.

const CHECKMARK_ICON: char

The char representing a ✔ icon in the ICON_FONT.

const ARROW_DOWN_ICON: char

The char representing a ▼ icon in the built-in [ICONS] font.

Loading content...

Required methods

fn default_size(&self) -> u16

Returns the default size of text.

fn measure(
    &self,
    contents: &str,
    size: f32,
    font: Font,
    bounds: Size
) -> (f32, f32)

Measures the text contents with the given size and font, returning the size of a laid out paragraph that fits in the provided bounds.

Loading content...

Implementors

Loading content...