pub type DrawingText<'a> = Drawing<'a, Text>;
Expand description
The drawing context for the Text primitive.
Aliased Type§
struct DrawingText<'a> { /* private fields */ }
Implementations§
source§impl<'a> DrawingText<'a>
impl<'a> DrawingText<'a>
sourcepub fn no_line_wrap(self) -> Self
pub fn no_line_wrap(self) -> Self
Specify that the Text should not wrap lines around the width.
sourcepub fn wrap_by_word(self) -> Self
pub fn wrap_by_word(self) -> Self
Line wrap the Text at the beginning of the first word that exceeds the width.
sourcepub fn wrap_by_character(self) -> Self
pub fn wrap_by_character(self) -> Self
Line wrap the Text at the beginning of the first character that exceeds the width.
sourcepub fn font(self, font: Font) -> Self
pub fn font(self, font: Font) -> Self
A method for specifying the Font
used for displaying the Text
.
sourcepub fn with_style(self, style: Style) -> Self
pub fn with_style(self, style: Style) -> Self
Build the Text with the given Style.
sourcepub fn justify(self, justify: Justify) -> Self
pub fn justify(self, justify: Justify) -> Self
Describe the end along the x axis to which the text should be aligned.
sourcepub fn left_justify(self) -> Self
pub fn left_justify(self) -> Self
Align the text to the left of its bounding Rect’s x axis range.
sourcepub fn center_justify(self) -> Self
pub fn center_justify(self) -> Self
Align the text to the middle of its bounding Rect’s x axis range.
sourcepub fn right_justify(self) -> Self
pub fn right_justify(self) -> Self
Align the text to the right of its bounding Rect’s x axis range.
sourcepub fn line_spacing(self, spacing: Scalar) -> Self
pub fn line_spacing(self, spacing: Scalar) -> Self
Specify how much vertical space should separate each line of text.
sourcepub fn y_align_text(self, align: Align) -> Self
pub fn y_align_text(self, align: Align) -> Self
Specify how the whole text should be aligned along the y axis of its bounding rectangle
sourcepub fn align_text_top(self) -> Self
pub fn align_text_top(self) -> Self
Align the top edge of the text with the top edge of its bounding rectangle.
sourcepub fn align_text_middle_y(self) -> Self
pub fn align_text_middle_y(self) -> Self
Align the middle of the text with the middle of the bounding rect along the y axis.
This is the default behaviour.
sourcepub fn align_text_bottom(self) -> Self
pub fn align_text_bottom(self) -> Self
Align the bottom edge of the text with the bottom edge of its bounding rectangle.
sourcepub fn glyph_colors<I, C>(self, glyph_colors: I) -> Self
pub fn glyph_colors<I, C>(self, glyph_colors: I) -> Self
Set a color for each glyph, which is typically one character. Colors unspecified glyphs using the drawing color. NOTE: Sometimes, a glyph can represent multiple characters, or be a part in other glyphs.