pub struct FallbackChain { /* private fields */ }Expand description
An ordered list of font families used for glyph-level fallback.
The resolver walks the chain in order and returns the first family whose
Unicode-range heuristic covers ch. The last entry acts as a universal
fallback (“tofu” / .notdef).
Implementations§
Source§impl FallbackChain
impl FallbackChain
Sourcepub fn default_chain() -> Self
pub fn default_chain() -> Self
Construct the default fallback chain:
- CJK fonts — covers Unified Ideographs, Kana, Hangul …
- Emoji font — covers emoji symbol ranges
- Latin / universal fallback
Sourcepub fn add_family(&mut self, family: String)
pub fn add_family(&mut self, family: String)
Append a new family at the end of the chain (before the universal
fallback if one is present — this is handled automatically via the
chain-walk in Self::resolve_glyph).
Sourcepub fn resolve_glyph(&self, ch: char) -> Option<&str>
pub fn resolve_glyph(&self, ch: char) -> Option<&str>
Return the name of the first family in the chain that can render ch.
Returns None only when the chain is empty (which the default chain
never produces).
Sourcepub fn families(&self) -> &[FamilyEntry] ⓘ
pub fn families(&self) -> &[FamilyEntry] ⓘ
Borrow the family list.
Auto Trait Implementations§
impl Freeze for FallbackChain
impl RefUnwindSafe for FallbackChain
impl Send for FallbackChain
impl Sync for FallbackChain
impl Unpin for FallbackChain
impl UnsafeUnpin for FallbackChain
impl UnwindSafe for FallbackChain
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> 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