[][src]Trait coffee::ui::widget::text::Renderer

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

The renderer of a Text fragment.

Your core::Renderer will need to implement this trait before being able to use a Text in your user interface.

Required methods

fn node(&self, style: Style, content: &str, size: f32) -> 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<f32>,
    content: &str,
    size: f32,
    color: Color,
    horizontal_alignment: HorizontalAlignment,
    vertical_alignment: VerticalAlignment
)

Draws a Text fragment.

It receives:

Loading content...

Implementors

impl Renderer for Renderer[src]

Loading content...