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

pub trait Renderer<Color> {
    fn node(&self, style: Style, content: &str, size: Option<u16>) -> Node;
fn draw(
        &mut self,
        bounds: Rectangle,
        content: &str,
        size: Option<u16>,
        color: Option<Color>,
        horizontal_alignment: HorizontalAlignment,
        vertical_alignment: VerticalAlignment
    ); }

The renderer of a Text fragment with a generic Color.

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

Required methods

fn node(&self, style: Style, content: &str, size: Option<u16>) -> Node

Creates a Node with the given Style for the provided Text contents and size.

You should probably use Node::with_measure to allow Text to adapt to the dimensions of its container.

fn draw(
    &mut self,
    bounds: Rectangle,
    content: &str,
    size: Option<u16>,
    color: Option<Color>,
    horizontal_alignment: HorizontalAlignment,
    vertical_alignment: VerticalAlignment
)

Draws a Text fragment.

It receives:

Loading content...

Implementors

Loading content...