pub struct FontTextStyleBuilder<C: PixelColor> { /* private fields */ }
Expand description
Text style builder for ttf and otf fonts.
Use this builder to create [MonoTextStyle
]s for [Text
].
Implementations§
Source§impl<C: PixelColor> FontTextStyleBuilder<C>
impl<C: PixelColor> FontTextStyleBuilder<C>
Sourcepub fn font_size(self, font_size: u32) -> Self
pub fn font_size(self, font_size: u32) -> Self
Builder method used to set the font size of the style.
Sourcepub fn strikethrough(self) -> Self
pub fn strikethrough(self) -> Self
Enables strikethrough using the text color.
Sourcepub fn text_color(self, text_color: C) -> Self
pub fn text_color(self, text_color: C) -> Self
Sets the text color.
Sourcepub fn background_color(self, background_color: C) -> Self
pub fn background_color(self, background_color: C) -> Self
Sets the background color.
Sourcepub fn underline_with_color(self, underline_color: C) -> Self
pub fn underline_with_color(self, underline_color: C) -> Self
Enables underline with a custom color.
Sourcepub fn strikethrough_with_color(self, strikethrough_color: C) -> Self
pub fn strikethrough_with_color(self, strikethrough_color: C) -> Self
Enables strikethrough with a custom color.
Sourcepub fn build(self) -> FontTextStyle<C>
pub fn build(self) -> FontTextStyle<C>
Builds the text style.
This method can only be called after a font was set by using the font
method. All other
settings are optional and they will be set to their default value if they are missing.
Auto Trait Implementations§
impl<C> Freeze for FontTextStyleBuilder<C>where
C: Freeze,
impl<C> RefUnwindSafe for FontTextStyleBuilder<C>where
C: RefUnwindSafe,
impl<C> !Send for FontTextStyleBuilder<C>
impl<C> !Sync for FontTextStyleBuilder<C>
impl<C> Unpin for FontTextStyleBuilder<C>where
C: Unpin,
impl<C> UnwindSafe for FontTextStyleBuilder<C>where
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.