pub struct ResolvedFontChains {
pub chains: HashMap<FontChainKeyOrRef, FontFallbackChain>,
pub unresolved_families: BTreeSet<String>,
pub last_resort_chains: usize,
}Expand description
Resolved font chains ready for use in layout
This is the result of resolving font stacks against FcFontCache
Fields§
§chains: HashMap<FontChainKeyOrRef, FontFallbackChain>Map from FontChainKeyOrRef to the resolved FontFallbackChain
For FontChainKeyOrRef::Ref variants, the FontFallbackChain contains
a single-font chain that covers the entire Unicode range.
unresolved_families: BTreeSet<String>CSS families that were REQUESTED but could not be matched to any font (not on disk, not registered in memory).
This used to be swallowed: the resolver moved on to the next family
and, if the whole stack failed, ensure_chains_nonempty quietly
attached an arbitrary system font. Every unmatched family therefore
collapsed onto the SAME FontId, text rendered in a font nobody
asked for, and no test could tell. A failed family match is now a
first-class output: it is recorded here and logged once
(see report_unresolved_families).
last_resort_chains: usizeChains that matched NOTHING at all and only render because
ensure_chains_nonempty attached a last-resort font. These are
rendering in a font the stylesheet never asked for.
Implementations§
Source§impl ResolvedFontChains
impl ResolvedFontChains
Sourcepub fn get(&self, key: &FontChainKeyOrRef) -> Option<&FontFallbackChain>
pub fn get(&self, key: &FontChainKeyOrRef) -> Option<&FontFallbackChain>
Get a font chain by its key
Sourcepub fn get_by_chain_key(&self, key: &FontChainKey) -> Option<&FontFallbackChain>
pub fn get_by_chain_key(&self, key: &FontChainKey) -> Option<&FontFallbackChain>
Get a font chain by FontChainKey (for system fonts)
Sourcepub fn get_for_font_stack(
&self,
font_stack: &[FontSelector],
) -> Option<&FontFallbackChain>
pub fn get_for_font_stack( &self, font_stack: &[FontSelector], ) -> Option<&FontFallbackChain>
Get a font chain for a font stack (via fontconfig)
Sourcepub fn get_for_font_ref(&self, ptr: usize) -> Option<&FontFallbackChain>
pub fn get_for_font_ref(&self, ptr: usize) -> Option<&FontFallbackChain>
Get a font chain for a FontRef pointer
Sourcepub fn into_inner(self) -> HashMap<FontChainKeyOrRef, FontFallbackChain>
pub fn into_inner(self) -> HashMap<FontChainKeyOrRef, FontFallbackChain>
Consume self and return the inner HashMap with FontChainKeyOrRef keys
This is useful when you need access to both Chain and Ref variants.
Sourcepub fn into_fontconfig_chains(self) -> HashMap<FontChainKey, FontFallbackChain>
pub fn into_fontconfig_chains(self) -> HashMap<FontChainKey, FontFallbackChain>
Consume self and return only the fontconfig-resolved chains
This filters out FontRef entries and returns only the chains
resolved via fontconfig. This is what FontManager expects.
Sourcepub fn font_refs_len(&self) -> usize
pub fn font_refs_len(&self) -> usize
Get the number of direct FontRefs
Trait Implementations§
Source§impl Clone for ResolvedFontChains
impl Clone for ResolvedFontChains
Source§fn clone(&self) -> ResolvedFontChains
fn clone(&self) -> ResolvedFontChains
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 ResolvedFontChains
impl Debug for ResolvedFontChains
Source§impl Default for ResolvedFontChains
impl Default for ResolvedFontChains
Source§fn default() -> ResolvedFontChains
fn default() -> ResolvedFontChains
Auto Trait Implementations§
impl Freeze for ResolvedFontChains
impl RefUnwindSafe for ResolvedFontChains
impl Send for ResolvedFontChains
impl Sync for ResolvedFontChains
impl Unpin for ResolvedFontChains
impl UnsafeUnpin for ResolvedFontChains
impl UnwindSafe for ResolvedFontChains
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<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