[−][src]Trait iced_native::widget::text::Renderer
The renderer of a Text
fragment.
Your renderer will need to implement this trait before being
able to use Text
in your UserInterface
.
Associated Types
Loading content...Required methods
fn default_size(&self) -> u16
Returns the default size of Text
.
fn measure(
&self,
content: &str,
size: u16,
font: Self::Font,
bounds: Size
) -> (f32, f32)
&self,
content: &str,
size: u16,
font: Self::Font,
bounds: Size
) -> (f32, f32)
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
&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
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
Implementors
impl Renderer for Null
[src]
type Font = Font
fn default_size(&self) -> u16
[src]
fn measure(
&self,
_content: &str,
_size: u16,
_font: Font,
_bounds: Size
) -> (f32, f32)
[src]
&self,
_content: &str,
_size: u16,
_font: Font,
_bounds: Size
) -> (f32, f32)
fn draw(
&mut self,
_defaults: &Self::Defaults,
_bounds: Rectangle,
_content: &str,
_size: u16,
_font: Font,
_color: Option<Color>,
_horizontal_alignment: HorizontalAlignment,
_vertical_alignment: VerticalAlignment
)
[src]
&mut self,
_defaults: &Self::Defaults,
_bounds: Rectangle,
_content: &str,
_size: u16,
_font: Font,
_color: Option<Color>,
_horizontal_alignment: HorizontalAlignment,
_vertical_alignment: VerticalAlignment
)