Struct embedded_graphics::mono_font::MonoTextStyle[][src]

#[non_exhaustive]
pub struct MonoTextStyle<'a, C> { pub text_color: Option<C>, pub background_color: Option<C>, pub underline_color: DecorationColor<C>, pub strikethrough_color: DecorationColor<C>, pub font: &'a MonoFont<'a>, }
Expand description

Style properties for text using a monospaced font.

A MonoTextStyle can be applied to a Text object to define how the text is drawn.

Because MonoTextStyle has the non_exhaustive attribute, it cannot be created using a struct literal. To create a MonoTextStyle with a given text color and transparent background, use the new method. For more complex text styles, use the MonoTextStyleBuilder.

Fields (Non-exhaustive)

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
text_color: Option<C>

Text color.

background_color: Option<C>

Background color.

underline_color: DecorationColor<C>

Underline color.

strikethrough_color: DecorationColor<C>

Strikethrough color.

font: &'a MonoFont<'a>

Font.

Implementations

Creates a text style with transparent background.

Returns true if the style is transparent.

Drawing a Text with a transparent MonoTextStyle will not draw any pixels.

Trait Implementations

The color type.

Sets the text color.

Sets the background color.

Sets the underline color.

Sets the strikethrough color.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Color type.

Draws a string. Read more

Draws whitespace of the given width. Read more

Returns the text metrics for a string. Read more

Returns the default line height. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Casts the value.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Casts the value.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Casts the value.

Should always be Self

Casts the value.

Performance hack: Clone doesn’t get inlined for Copy types in debug mode, so make it inline anyway.

Tests if Self the same as the type T Read more

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Casts the value.

Casts the value.