#[non_exhaustive]pub struct TextStyle {
pub name: String,
pub font: Option<String>,
pub height: f64,
pub width_factor: f64,
pub oblique: f64,
pub props: Props,
}Expand description
A text style definition.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringUnique name.
font: Option<String>Font file or font name.
height: f64Fixed text height, 0 when variable.
width_factor: f64Width factor (1.0 = normal).
oblique: f64Oblique angle in radians.
props: PropsFormat-specific extras.
Implementations§
Source§impl TextStyle
impl TextStyle
Sourcepub fn with_font(self, value: impl Into<String>) -> Self
pub fn with_font(self, value: impl Into<String>) -> Self
Sets Self::font to Some(value).
Sourcepub fn with_height(self, value: f64) -> Self
pub fn with_height(self, value: f64) -> Self
Sets Self::height.
Sourcepub fn with_width_factor(self, value: f64) -> Self
pub fn with_width_factor(self, value: f64) -> Self
Sets Self::width_factor.
Sourcepub fn with_oblique(self, value: f64) -> Self
pub fn with_oblique(self, value: f64) -> Self
Sets Self::oblique.
Sourcepub fn with_props(self, value: Props) -> Self
pub fn with_props(self, value: Props) -> Self
Sets Self::props.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TextStyle
impl<'de> Deserialize<'de> for TextStyle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for TextStyle
Auto Trait Implementations§
impl Forget for TextStyle
impl Freeze for TextStyle
impl Move 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