Trait iced_native::widget::text::Renderer[][src]

pub trait Renderer: Renderer {
    type Font: Default + Copy;
    fn default_size(&self) -> u16;
fn measure(
        &self,
        content: &str,
        size: u16,
        font: Self::Font,
        bounds: Size
    ) -> (f32, f32);
fn draw(
        &mut self,
        defaults: &Self::Defaults,
        bounds: Rectangle,
        content: &str,
        size: u16,
        font: Self::Font,
        color: Option<Color>,
        horizontal_alignment: HorizontalAlignment,
        vertical_alignment: VerticalAlignment
    ) -> Self::Output; }

The renderer of a Text fragment.

Your renderer will need to implement this trait before being able to use Text in your user interface.

Associated Types

type Font: Default + Copy[src]

The font type used for Text.

Loading content...

Required methods

fn default_size(&self) -> u16[src]

Returns the default size of Text.

fn measure(
    &self,
    content: &str,
    size: u16,
    font: Self::Font,
    bounds: Size
) -> (f32, f32)
[src]

Measures the Text in the given bounds and returns the minimum boundaries that can fit the contents.

fn draw(
    &mut self,
    defaults: &Self::Defaults,
    bounds: Rectangle,
    content: &str,
    size: u16,
    font: Self::Font,
    color: Option<Color>,
    horizontal_alignment: HorizontalAlignment,
    vertical_alignment: VerticalAlignment
) -> Self::Output
[src]

Draws a Text fragment.

It receives:

Loading content...

Implementors

impl Renderer for Null[src]

type Font = Font

Loading content...