pub enum FontFamily {
SystemUi,
Named(Vec<String>),
NamedWithGeneric(Vec<FamilyName>),
}Expand description
Font family selection.
The default, FontFamily::SystemUi, resolves to the platform UI font
(e.g. San Francisco on macOS) via fontique’s system collection with no
registration required. FontFamily::Named is an ordered fallback stack
of named families, tried in order; a name that doesn’t resolve on the
current platform falls back per parley’s own fallback behavior — no error
surface is exposed here. FontFamily::NamedWithGeneric extends
FontFamily::Named by allowing the stack to end with a generic
fallback family (e.g. monospace, serif).
Variants§
SystemUi
The platform system UI font. Default.
Named(Vec<String>)
An ordered fallback stack of named font families.
NamedWithGeneric(Vec<FamilyName>)
An ordered fallback stack of named families ending in a generic fallback.
Implementations§
Source§impl FontFamily
impl FontFamily
Sourcepub fn stack(names: impl IntoIterator<Item = impl Into<String>>) -> Self
pub fn stack(names: impl IntoIterator<Item = impl Into<String>>) -> Self
An ordered fallback stack of named font families, tried in order.
Sourcepub fn stack_with_generic(
names: impl IntoIterator<Item = impl Into<String>>,
generic: GenericSlot,
) -> Self
pub fn stack_with_generic( names: impl IntoIterator<Item = impl Into<String>>, generic: GenericSlot, ) -> Self
An ordered fallback stack of named font families ending in a generic fallback family.
§Example
use frust_text::{FontFamily, GenericSlot};
// Try "IBM Plex Mono" first, fall back to system monospace
let family = FontFamily::stack_with_generic(
["IBM Plex Mono"],
GenericSlot::Monospace,
);