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
sourceimpl<C, F> TextStyle<C, F> where
C: PixelColor,
F: Font,
impl<C, F> TextStyle<C, F> where
C: PixelColor,
F: Font,
Trait Implementations
sourceimpl<C: Ord, F: Ord> Ord for TextStyle<C, F> where
C: PixelColor,
F: Font,
impl<C: Ord, F: Ord> Ord for TextStyle<C, F> where
C: PixelColor,
F: Font,
sourceimpl<C: PartialEq, F: PartialEq> PartialEq<TextStyle<C, F>> for TextStyle<C, F> where
C: PixelColor,
F: Font,
impl<C: PartialEq, F: PartialEq> PartialEq<TextStyle<C, F>> for TextStyle<C, F> where
C: PixelColor,
F: Font,
sourceimpl<C: PartialOrd, F: PartialOrd> PartialOrd<TextStyle<C, F>> for TextStyle<C, F> where
C: PixelColor,
F: Font,
impl<C: PartialOrd, F: PartialOrd> PartialOrd<TextStyle<C, F>> for TextStyle<C, F> where
C: PixelColor,
F: Font,
sourcefn partial_cmp(&self, other: &TextStyle<C, F>) -> Option<Ordering>
fn partial_cmp(&self, other: &TextStyle<C, F>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl<C: Copy, F: Copy> Copy for TextStyle<C, F> where
C: PixelColor,
F: Font,
impl<C: Eq, F: Eq> Eq for TextStyle<C, F> where
C: PixelColor,
F: Font,
impl<C, F> StructuralEq for TextStyle<C, F> where
C: PixelColor,
F: Font,
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> where
C: Send,
F: Send,
impl<C, F> Sync for TextStyle<C, F> where
C: Sync,
F: Sync,
impl<C, F> Unpin for TextStyle<C, F> where
C: Unpin,
F: Unpin,
impl<C, F> UnwindSafe for TextStyle<C, F> where
C: UnwindSafe,
F: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more