[−][src]Trait coffee::ui::widget::text::Renderer
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
)
&mut self,
bounds: Rectangle<f32>,
content: &str,
size: f32,
color: Color,
horizontal_alignment: HorizontalAlignment,
vertical_alignment: VerticalAlignment
)
Draws a Text
fragment.
It receives:
- the bounds of the
Text
- the contents of the
Text
- the size of the
Text
- the color of the
Text
- the
HorizontalAlignment
of theText
- the
VerticalAlignment
of theText