pub enum FontStack {
Stack(Vec<FontSelector>),
Ref(FontRef),
}Expand description
Font stack that can be either a list of font selectors (resolved via fontconfig) or a direct FontRef (bypasses fontconfig entirely).
When a FontRef is used, it bypasses fontconfig resolution entirely
and uses the pre-parsed font data directly. This is used for embedded
fonts like Material Icons.
Variants§
Stack(Vec<FontSelector>)
A stack of font selectors to be resolved via fontconfig First font is primary, rest are fallbacks
Ref(FontRef)
A direct reference to a pre-parsed font (e.g., embedded icon fonts) This font covers the entire Unicode range and has no fallbacks.
Implementations§
Source§impl FontStack
impl FontStack
Sourcepub fn as_stack(&self) -> Option<&[FontSelector]>
pub fn as_stack(&self) -> Option<&[FontSelector]>
Returns the font selectors if this is a Stack variant
Sourcepub fn first_selector(&self) -> Option<&FontSelector>
pub fn first_selector(&self) -> Option<&FontSelector>
Returns the first FontSelector if this is a Stack variant, None if Ref
Sourcepub fn first_family(&self) -> &str
pub fn first_family(&self) -> &str
Returns the first font family name (for Stack) or a placeholder (for Ref)
Trait Implementations§
impl Eq for FontStack
Auto Trait Implementations§
impl Freeze for FontStack
impl RefUnwindSafe for FontStack
impl Send for FontStack
impl Sync for FontStack
impl Unpin for FontStack
impl UnwindSafe for FontStack
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more