#[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> PartialOrd for TextStyle<C, F>
impl<C, F> PartialOrd for TextStyle<C, F>
impl<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> Freeze for TextStyle<C, F>
impl<C, F> RefUnwindSafe for TextStyle<C, F>where
F: RefUnwindSafe,
C: 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
F: UnwindSafe,
C: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.