[−][src]Trait iced::widget::text::Renderer
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
)
&mut self,
bounds: Rectangle,
content: &str,
size: Option<u16>,
color: Option<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