[][src]Struct embedded_graphics::style::TextStyle

#[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, }

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)

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.

Methods

impl<C, F> TextStyle<C, F> where
    C: PixelColor,
    F: Font
[src]

pub fn new(font: F, text_color: C) -> Self[src]

Creates a text style with transparent background.

Trait Implementations

impl<C: Clone, F: Clone> Clone for TextStyle<C, F> where
    C: PixelColor,
    F: Font
[src]

impl<C: Copy, F: Copy> Copy for TextStyle<C, F> where
    C: PixelColor,
    F: Font
[src]

impl<C: Debug, F: Debug> Debug for TextStyle<C, F> where
    C: PixelColor,
    F: Font
[src]

impl<C: Default, F: Default> Default for TextStyle<C, F> where
    C: PixelColor,
    F: Font
[src]

impl<C: Eq, F: Eq> Eq for TextStyle<C, F> where
    C: PixelColor,
    F: Font
[src]

impl<C: Hash, F: Hash> Hash for TextStyle<C, F> where
    C: PixelColor,
    F: Font
[src]

impl<C: Ord, F: Ord> Ord for TextStyle<C, F> where
    C: PixelColor,
    F: Font
[src]

impl<C: PartialEq, F: PartialEq> PartialEq<TextStyle<C, F>> for TextStyle<C, F> where
    C: PixelColor,
    F: Font
[src]

impl<C: PartialOrd, F: PartialOrd> PartialOrd<TextStyle<C, F>> for TextStyle<C, F> where
    C: PixelColor,
    F: Font
[src]

impl<C, F> StructuralEq for TextStyle<C, F> where
    C: PixelColor,
    F: Font
[src]

impl<C, F> StructuralPartialEq for TextStyle<C, F> where
    C: PixelColor,
    F: Font
[src]

Auto Trait Implementations

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Scalar for T where
    T: PartialEq<T> + Copy + Any + Debug
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,