pub enum MemoryFontTier {
Primary,
Fallback,
}Expand description
How a registered in-memory face ranks against fonts on disk.
The distinction exists because “register a font by name” means two different
things. A font the caller explicitly supplied for a family is that family
and must beat anything installed, exactly as CSS says. A font offered as a
stand-in for a generic family - the 14 standard PDF fonts answering
sans-serif, say - must not, or a Win-1252 subset would displace the
system’s full Unicode faces on every desktop.
Without the second tier the choice is all-or-nothing: claim sans-serif and
wreck desktop, or leave it alone and have nothing at all on a target with no
fonts on disk, such as wasm.
Variants§
Primary
Wins over anything on disk. The right tier for a font the caller named.
Fallback
Used only after disk resolution has had its turn. The right tier for a last-resort face standing in for a generic family.
Trait Implementations§
Source§impl Clone for MemoryFontTier
impl Clone for MemoryFontTier
Source§fn clone(&self) -> MemoryFontTier
fn clone(&self) -> MemoryFontTier
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MemoryFontTier
Source§impl Debug for MemoryFontTier
impl Debug for MemoryFontTier
impl Eq for MemoryFontTier
Source§impl PartialEq for MemoryFontTier
impl PartialEq for MemoryFontTier
impl StructuralPartialEq for MemoryFontTier
Auto Trait Implementations§
impl Freeze for MemoryFontTier
impl RefUnwindSafe for MemoryFontTier
impl Send for MemoryFontTier
impl Sync for MemoryFontTier
impl Unpin for MemoryFontTier
impl UnsafeUnpin for MemoryFontTier
impl UnwindSafe for MemoryFontTier
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
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
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>
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>
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