#[non_exhaustive]pub struct StyleInfo {Show 15 fields
pub font_size: i32,
pub pixel_font_size: f64,
pub letter_spacing: f64,
pub font_type: String,
pub bold: bool,
pub italic: bool,
pub underlined: bool,
pub strikeout: bool,
pub subscript: bool,
pub superscript: bool,
pub smallcaps: bool,
pub font_weight: i32,
pub handwritten: bool,
pub text_color: Option<Color>,
pub background_color: Option<Color>,
/* private fields */
}Expand description
Font and other text style attributes.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.font_size: i32Font size in points (1 point is ¹⁄₇₂ inches).
pixel_font_size: f64Font size in pixels, equal to unrounded font_size
- resolution ÷
72.0.
letter_spacing: f64Letter spacing in points.
font_type: StringName or style of the font.
bold: boolWhether the text is bold (equivalent to
font_weight
is at least 700).
italic: boolWhether the text is italic.
underlined: boolWhether the text is underlined.
strikeout: boolWhether the text is strikethrough. This feature is not supported yet.
subscript: boolWhether the text is a subscript. This feature is not supported yet.
superscript: boolWhether the text is a superscript. This feature is not supported yet.
smallcaps: boolWhether the text is in small caps. This feature is not supported yet.
font_weight: i32TrueType weight on a scale 100 (thin) to 1000 (ultra-heavy).
Normal is 400, bold is 700.
handwritten: boolWhether the text is handwritten.
text_color: Option<Color>Color of the text.
background_color: Option<Color>Color of the background.
Implementations§
Source§impl StyleInfo
impl StyleInfo
pub fn new() -> Self
Sourcepub fn set_font_size<T: Into<i32>>(self, v: T) -> Self
pub fn set_font_size<T: Into<i32>>(self, v: T) -> Self
Sets the value of font_size.
Sourcepub fn set_pixel_font_size<T: Into<f64>>(self, v: T) -> Self
pub fn set_pixel_font_size<T: Into<f64>>(self, v: T) -> Self
Sets the value of pixel_font_size.
Sourcepub fn set_letter_spacing<T: Into<f64>>(self, v: T) -> Self
pub fn set_letter_spacing<T: Into<f64>>(self, v: T) -> Self
Sets the value of letter_spacing.
Sourcepub fn set_font_type<T: Into<String>>(self, v: T) -> Self
pub fn set_font_type<T: Into<String>>(self, v: T) -> Self
Sets the value of font_type.
Sourcepub fn set_italic<T: Into<bool>>(self, v: T) -> Self
pub fn set_italic<T: Into<bool>>(self, v: T) -> Self
Sets the value of italic.
Sourcepub fn set_underlined<T: Into<bool>>(self, v: T) -> Self
pub fn set_underlined<T: Into<bool>>(self, v: T) -> Self
Sets the value of underlined.
Sourcepub fn set_strikeout<T: Into<bool>>(self, v: T) -> Self
pub fn set_strikeout<T: Into<bool>>(self, v: T) -> Self
Sets the value of strikeout.
Sourcepub fn set_subscript<T: Into<bool>>(self, v: T) -> Self
pub fn set_subscript<T: Into<bool>>(self, v: T) -> Self
Sets the value of subscript.
Sourcepub fn set_superscript<T: Into<bool>>(self, v: T) -> Self
pub fn set_superscript<T: Into<bool>>(self, v: T) -> Self
Sets the value of superscript.
Sourcepub fn set_smallcaps<T: Into<bool>>(self, v: T) -> Self
pub fn set_smallcaps<T: Into<bool>>(self, v: T) -> Self
Sets the value of smallcaps.
Sourcepub fn set_font_weight<T: Into<i32>>(self, v: T) -> Self
pub fn set_font_weight<T: Into<i32>>(self, v: T) -> Self
Sets the value of font_weight.
Sourcepub fn set_handwritten<T: Into<bool>>(self, v: T) -> Self
pub fn set_handwritten<T: Into<bool>>(self, v: T) -> Self
Sets the value of handwritten.
Sourcepub fn set_text_color<T>(self, v: T) -> Self
pub fn set_text_color<T>(self, v: T) -> Self
Sets the value of text_color.
Sourcepub fn set_or_clear_text_color<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_text_color<T>(self, v: Option<T>) -> Self
Sets or clears the value of text_color.
Sourcepub fn set_background_color<T>(self, v: T) -> Self
pub fn set_background_color<T>(self, v: T) -> Self
Sets the value of background_color.
Sourcepub fn set_or_clear_background_color<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_background_color<T>(self, v: Option<T>) -> Self
Sets or clears the value of background_color.