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
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
Trait Implementations
type Color = C
type Color = C
The color type.
Sets the text color.
Sets the background color.
Sets the underline color.
Sets the strikethrough color.
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl<'a, C> !RefUnwindSafe for MonoTextStyle<'a, C>
impl<'a, C> !Send for MonoTextStyle<'a, C>
impl<'a, C> !Sync for MonoTextStyle<'a, C>
impl<'a, C> Unpin for MonoTextStyle<'a, C> where
C: Unpin,
impl<'a, C> !UnwindSafe for MonoTextStyle<'a, C>
Blanket Implementations
Mutably borrows from an owned value. Read more
Casts the value.
Performs the conversion.
Performs the conversion.
Casts the value.
type Output = T
type Output = T
Should always be Self
Casts the value.
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
Casts the value.
pub fn vzip(self) -> V
Casts the value.