Type Alias nannou::draw::primitive::text::DrawingText

source ·
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>

source

pub fn font_size(self, size: FontSize) -> Self

The font size to use for the text.

source

pub fn no_line_wrap(self) -> Self

Specify that the Text should not wrap lines around the width.

source

pub fn wrap_by_word(self) -> Self

Line wrap the Text at the beginning of the first word that exceeds the width.

source

pub fn wrap_by_character(self) -> Self

Line wrap the Text at the beginning of the first character that exceeds the width.

source

pub fn font(self, font: Font) -> Self

A method for specifying the Font used for displaying the Text.

source

pub fn with_style(self, style: Style) -> Self

Build the Text with the given Style.

source

pub fn justify(self, justify: Justify) -> Self

Describe the end along the x axis to which the text should be aligned.

source

pub fn left_justify(self) -> Self

Align the text to the left of its bounding Rect’s x axis range.

source

pub fn center_justify(self) -> Self

Align the text to the middle of its bounding Rect’s x axis range.

source

pub fn right_justify(self) -> Self

Align the text to the right of its bounding Rect’s x axis range.

source

pub fn line_spacing(self, spacing: Scalar) -> Self

Specify how much vertical space should separate each line of text.

source

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

source

pub fn align_text_top(self) -> Self

Align the top edge of the text with the top edge of its bounding rectangle.

source

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.

source

pub fn align_text_bottom(self) -> Self

Align the bottom edge of the text with the bottom edge of its bounding rectangle.

source

pub fn layout(self, layout: &Layout) -> Self

Set all the parameters via an existing Layout

source

pub fn glyph_colors<I, C>(self, glyph_colors: I) -> Self
where I: IntoIterator<Item = C>, C: IntoLinSrgba<ColorScalar>,

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.