pub struct FontSpec {
pub family: Option<Arc<str>>,
pub size: Option<FontSize>,
pub weight: Option<u16>,
pub style: Option<FontStyle>,
pub color: Option<Rgba>,
}Expand description
Font specification: family name, size, weight, style, and color.
All fields are optional to support partial overlays – a FontSpec with
only size set will only override the size when merged.
Default behavior asymmetry: During validation, family, size,
weight, and color are required (missing values produce a validation
error). style silently defaults to FontStyle::Normal because
Normal is the universally-safe default – no theme ever intends to
leave style undefined in a way that would produce incorrect rendering.
Fields§
§family: Option<Arc<str>>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_logical_px(dpi).
weight: Option<u16>CSS font weight (100–900).
style: Option<FontStyle>Font style (normal, italic, oblique).
color: Option<Rgba>Font color.