pub struct ResolvedFontChains {
pub chains: HashMap<FontChainKeyOrRef, FontFallbackChain>,
}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.
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 moreAuto 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