pub struct Text { /* private fields */ }
Expand description
Text representation
Implementations§
Source§impl Text
impl Text
Sourcepub fn foreground_color(self, foreground_color: ForegroundColor) -> Self
pub fn foreground_color(self, foreground_color: ForegroundColor) -> Self
Set the foreground color of the text
Sourcepub fn background_color(self, background_color: BackgroundColor) -> Self
pub fn background_color(self, background_color: BackgroundColor) -> Self
Set the background color of the text
Sourcepub fn is_strikeout(self) -> Self
pub fn is_strikeout(self) -> Self
Toggle the strikeout style for the text
Sourcepub fn is_underline(self) -> Self
pub fn is_underline(self) -> Self
Toggle the underline style for the text
Sourcepub fn font_weight(self, weight: Weight) -> Self
pub fn font_weight(self, weight: Weight) -> Self
Set the weight of the font
- Weight::Heavy => 900
- Weight::ExtraBold => 800
- Weight::Bold => 700
- Weight::SemiBold => 600
- Weight::Medium => 500 | Default
- Weight::Normal => 400
- Weight::Light => 300
- Weight::ExtraLight => 200
- Weight::Thin => 100
Sourcepub fn font_custom(self, name: impl ToString) -> Self
pub fn font_custom(self, name: impl ToString) -> Self
Set a custom font name
Sourcepub fn font_default(self, def: DefaultFontFamily) -> Self
pub fn font_default(self, def: DefaultFontFamily) -> Self
Set the default font family type
- Serif
- SansSerif | Default
- Monospace
- Cursive
- Fantasy
- SystemUi
Sourcepub fn font_style(self, font: FontStyle) -> Self
pub fn font_style(self, font: FontStyle) -> Self
Set the complete FontStyle directly
Sourcepub fn get_content(&self) -> &str
pub fn get_content(&self) -> &str
Get the text content
Sourcepub fn get_foreground_color(&self) -> ForegroundColor
pub fn get_foreground_color(&self) -> ForegroundColor
Get the foreground color
Sourcepub fn get_background_color(&self) -> BackgroundColor
pub fn get_background_color(&self) -> BackgroundColor
Get the background color
Trait Implementations§
Source§impl From<Text> for Components
impl From<Text> for Components
Source§impl PartialOrd for Text
impl PartialOrd for Text
impl StructuralPartialEq for Text
Auto Trait Implementations§
impl Freeze for Text
impl RefUnwindSafe for Text
impl Send for Text
impl Sync for Text
impl Unpin for Text
impl UnwindSafe for Text
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