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 named(name: impl Into<String>) -> FontFamily
pub fn named(name: impl Into<String>) -> FontFamily
A single named font family.
Sourcepub fn stack(names: impl IntoIterator<Item = impl Into<String>>) -> FontFamily
pub fn stack(names: impl IntoIterator<Item = impl Into<String>>) -> FontFamily
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,
) -> FontFamily
pub fn stack_with_generic( names: impl IntoIterator<Item = impl Into<String>>, generic: GenericSlot, ) -> FontFamily
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,
);Trait Implementations§
Source§impl Clone for FontFamily
impl Clone for FontFamily
Source§fn clone(&self) -> FontFamily
fn clone(&self) -> FontFamily
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FontFamily
impl Debug for FontFamily
Source§impl Default for FontFamily
impl Default for FontFamily
Source§fn default() -> FontFamily
fn default() -> FontFamily
impl Eq for FontFamily
Source§impl PartialEq for FontFamily
impl PartialEq for FontFamily
impl StructuralPartialEq for FontFamily
Auto Trait Implementations§
impl Freeze for FontFamily
impl RefUnwindSafe for FontFamily
impl Send for FontFamily
impl Sync for FontFamily
impl Unpin for FontFamily
impl UnsafeUnpin for FontFamily
impl UnwindSafe for FontFamily
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
impl<T> Brush for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.