pub struct Font {
pub name: Option<String>,
pub size: Option<f64>,
pub weight: FontWeight,
pub style: FontStyle,
pub underline: UnderlineStyle,
pub strikethrough: bool,
pub color: Option<Color>,
pub family: Option<String>,
}Expand description
Font properties
Fields§
§name: Option<String>Font name
size: Option<f64>Font size in points
weight: FontWeightFont weight
style: FontStyleFont style
underline: UnderlineStyleUnderline style
strikethrough: boolStrikethrough
color: Option<Color>Font color
family: Option<String>Font family
Implementations§
Source§impl Font
impl Font
Sourcepub fn with_weight(self, weight: FontWeight) -> Self
pub fn with_weight(self, weight: FontWeight) -> Self
Set font weight
Sourcepub fn with_style(self, style: FontStyle) -> Self
pub fn with_style(self, style: FontStyle) -> Self
Set font style
Sourcepub fn with_underline(self, underline: UnderlineStyle) -> Self
pub fn with_underline(self, underline: UnderlineStyle) -> Self
Set underline
Sourcepub fn with_strikethrough(self, strikethrough: bool) -> Self
pub fn with_strikethrough(self, strikethrough: bool) -> Self
Set strikethrough
Sourcepub fn with_color(self, color: Color) -> Self
pub fn with_color(self, color: Color) -> Self
Set font color
Sourcepub fn with_family(self, family: String) -> Self
pub fn with_family(self, family: String) -> Self
Set font family
Sourcepub fn has_underline(&self) -> bool
pub fn has_underline(&self) -> bool
Check if font has underline
Sourcepub fn has_strikethrough(&self) -> bool
pub fn has_strikethrough(&self) -> bool
Check if font has strikethrough
Trait Implementations§
impl StructuralPartialEq for Font
Auto Trait Implementations§
impl Freeze for Font
impl RefUnwindSafe for Font
impl Send for Font
impl Sync for Font
impl Unpin for Font
impl UnsafeUnpin for Font
impl UnwindSafe for Font
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