logo
#[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.

Casts the value.

Casts the value.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Casts the value.

OverflowingCasts the value.

Casts the value.

Casts the value.

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.

UnwrappedCasts the value.

Casts the value.

WrappingCasts the value.