pub struct TypeScale {Show 30 fields
pub display_large: TextStyle,
pub display_medium: TextStyle,
pub display_small: TextStyle,
pub headline_large: TextStyle,
pub headline_medium: TextStyle,
pub headline_small: TextStyle,
pub title_large: TextStyle,
pub title_medium: TextStyle,
pub title_small: TextStyle,
pub body_large: TextStyle,
pub body_medium: TextStyle,
pub body_small: TextStyle,
pub label_large: TextStyle,
pub label_medium: TextStyle,
pub label_small: TextStyle,
pub display_large_emphasized: TextStyle,
pub display_medium_emphasized: TextStyle,
pub display_small_emphasized: TextStyle,
pub headline_large_emphasized: TextStyle,
pub headline_medium_emphasized: TextStyle,
pub headline_small_emphasized: TextStyle,
pub title_large_emphasized: TextStyle,
pub title_medium_emphasized: TextStyle,
pub title_small_emphasized: TextStyle,
pub body_large_emphasized: TextStyle,
pub body_medium_emphasized: TextStyle,
pub body_small_emphasized: TextStyle,
pub label_large_emphasized: TextStyle,
pub label_medium_emphasized: TextStyle,
pub label_small_emphasized: TextStyle,
}Expand description
The 15 named type-scale presets, each a full TextStyle, plus 15
_emphasized siblings (see the module docs’ “Emphasized type scale”
section).
Build one from a base style (its family/style/color are kept;
size/weight/letter_spacing/line_height are overridden per token)
via TypeScale::neutral — the only constructor this crate carries; a
design system builds its own from its own plugin crate (see the module
docs).
Fields§
§display_large: TextStyle§display_medium: TextStyle§display_small: TextStyle§headline_large: TextStyle§headline_medium: TextStyle§headline_small: TextStyle§title_large: TextStyle§title_medium: TextStyle§title_small: TextStyle§body_large: TextStyle§body_medium: TextStyle§body_small: TextStyle§label_large: TextStyle§label_medium: TextStyle§label_small: TextStyle§display_large_emphasized: TextStyle§display_medium_emphasized: TextStyle§display_small_emphasized: TextStyle§headline_large_emphasized: TextStyle§headline_medium_emphasized: TextStyle§headline_small_emphasized: TextStyle§title_large_emphasized: TextStyle§title_medium_emphasized: TextStyle§title_small_emphasized: TextStyle§body_large_emphasized: TextStyle§body_medium_emphasized: TextStyle§body_small_emphasized: TextStyle§label_large_emphasized: TextStyle§label_medium_emphasized: TextStyle§label_small_emphasized: TextStyleImplementations§
Source§impl TypeScale
impl TypeScale
Sourcepub fn neutral(base: &TextStyle) -> Self
pub fn neutral(base: &TextStyle) -> Self
Builds the neutral, design-language-free type scale from base (its
style/color are preserved).
Reuses the same numeric size/weight/tracking/line-height progression
frust-material’s M3-sourced type scale carries (see the module
docs) — a type scale isn’t a branded artifact the way a named font
face is, so there’s no design-language-specific value here to
invent (see crate::theme::Theme::neutral’s module docs). The one
thing this constructor overrides is family: every slot forces a
generic sans-serif stack via FontFamily::stack_with_generic (no
named font at all, ending in GenericSlot::SansSerif) rather than
inheriting whatever base supplies — no bundled font bytes are
referenced, so this compiles and behaves identically whether or not
the glyph-fonts feature is enabled.