pub struct TextStyle {
pub weight: FontWeight,
pub italic: bool,
pub color: Color,
pub underline: bool,
pub strikethrough: bool,
}Expand description
Text styling information.
Fields§
§weight: FontWeightFont weight (normal, bold, etc.)
italic: boolWhether the text is italic
color: ColorText color
underline: boolWhether the text is underlined
strikethrough: boolWhether the text has a strikethrough
Implementations§
Source§impl TextStyle
impl TextStyle
Sourcepub fn bold_italic() -> Self
pub fn bold_italic() -> Self
Create a bold-italic text style.
Sourcepub fn with_weight(self, weight: FontWeight) -> Self
pub fn with_weight(self, weight: FontWeight) -> Self
Set font weight.
Sourcepub fn with_italic(self, italic: bool) -> Self
pub fn with_italic(self, italic: bool) -> Self
Set italic style.
Sourcepub fn with_color(self, color: Color) -> Self
pub fn with_color(self, color: Color) -> Self
Set text color.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TextStyle
impl RefUnwindSafe for TextStyle
impl Send for TextStyle
impl Sync for TextStyle
impl Unpin for TextStyle
impl UnsafeUnpin for TextStyle
impl UnwindSafe for TextStyle
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