pub struct FontSpec {
pub family: Option<String>,
pub size: Option<FontSize>,
pub weight: Option<u16>,
pub style: Option<FontStyle>,
pub color: Option<Rgba>,
}Expand description
Font specification: family name, size, and weight.
All fields are optional to support partial overlays — a FontSpec with
only size set will only override the size when merged.
Fields§
§family: Option<String>Font family name (e.g., “Inter”, “Noto Sans”).
size: Option<FontSize>Font size with explicit unit (points or pixels).
In TOML, set as size_pt (typographic points) or size_px (logical
pixels). Converted to f32 logical pixels during validation via
FontSize::to_px(dpi).
weight: Option<u16>CSS font weight (100–900).
style: Option<FontStyle>Font style (normal, italic, oblique).
color: Option<Rgba>Font color.
Implementations§
Source§impl FontSpec
impl FontSpec
Sourcepub const FIELD_NAMES: &[&str]
pub const FIELD_NAMES: &[&str]
All serialized field names for FontSpec, for TOML linting.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FontSpec
impl<'de> Deserialize<'de> for FontSpec
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 FontSpec
Auto Trait Implementations§
impl Freeze for FontSpec
impl RefUnwindSafe for FontSpec
impl Send for FontSpec
impl Sync for FontSpec
impl Unpin for FontSpec
impl UnsafeUnpin for FontSpec
impl UnwindSafe for FontSpec
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