Struct embedded_graphics::style::TextStyle
source · #[non_exhaustive]pub struct TextStyle<C, F>where
C: PixelColor,
F: Font,{
pub text_color: Option<C>,
pub background_color: Option<C>,
pub font: F,
}
Expand description
Style properties for text.
A TextStyle
can be applied to a Text
object to define how the text is drawn.
Because TextStyle
has the non_exhaustive
attribute, it cannot be created using a struct
literal. To create a TextStyle
, use the text_style!
macro or TextStyleBuilder
.
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.
font: F
Font.
Implementations§
Trait Implementations§
source§impl<C, F> Ord for TextStyle<C, F>
impl<C, F> Ord for TextStyle<C, F>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<C, F> PartialEq for TextStyle<C, F>
impl<C, F> PartialEq for TextStyle<C, F>
source§impl<C, F> PartialOrd for TextStyle<C, F>
impl<C, F> PartialOrd for TextStyle<C, F>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<C, F> Copy for TextStyle<C, F>
impl<C, F> Eq for TextStyle<C, F>
impl<C, F> StructuralPartialEq for TextStyle<C, F>where
C: PixelColor,
F: Font,
Auto Trait Implementations§
impl<C, F> RefUnwindSafe for TextStyle<C, F>where
C: RefUnwindSafe,
F: RefUnwindSafe,
impl<C, F> Send for TextStyle<C, F>
impl<C, F> Sync for TextStyle<C, F>
impl<C, F> Unpin for TextStyle<C, F>
impl<C, F> UnwindSafe for TextStyle<C, F>where
C: UnwindSafe,
F: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more