pub struct FontFallbackChain {
pub css_fallbacks: Vec<CssFallbackGroup>,
pub unicode_fallbacks: Vec<ScriptFallbackGroup>,
pub last_resort: Vec<FontMatch>,
pub original_stack: Vec<String>,
}Expand description
A resolved font fallback chain for one CSS font stack and style.
Fields§
§css_fallbacks: Vec<CssFallbackGroup>The CSS stack, entry by entry.
unicode_fallbacks: Vec<ScriptFallbackGroup>One group per requested script block that has any candidate. Fonts
already reachable through css_fallbacks are not repeated here.
last_resort: Vec<FontMatch>FcFallbackConfig::last_resort, resolved. The first entry is used
for any character nothing above covers.
original_stack: Vec<String>The stack as requested, unexpanded.
Implementations§
Source§impl FontFallbackChain
impl FontFallbackChain
Sourcepub fn resolve_codepoint(&self, cp: u32) -> Option<(FontId, &str)>
pub fn resolve_codepoint(&self, cp: u32) -> Option<(FontId, &str)>
Returns the resolved font for a given codepoint and the CSS fallback tier it came from.
Sourcepub fn resolve_char(
&self,
_cache: &FcFontCache,
ch: char,
) -> Option<(FontId, String)>
pub fn resolve_char( &self, _cache: &FcFontCache, ch: char, ) -> Option<(FontId, String)>
Similar to resolve_codepoint, but takes a char and unused cache reference
for backward compatibility with 4.x.
Sourcepub fn resolve_text(
&self,
cache: &FcFontCache,
text: &str,
) -> Vec<(char, Option<(FontId, String)>)>
pub fn resolve_text( &self, cache: &FcFontCache, text: &str, ) -> Vec<(char, Option<(FontId, String)>)>
Per-character resolution of text.
Sourcepub fn query_for_text(
&self,
_cache: &FcFontCache,
text: &str,
) -> Vec<ResolvedFontRun>
pub fn query_for_text( &self, _cache: &FcFontCache, text: &str, ) -> Vec<ResolvedFontRun>
Split text into runs of consecutive characters that resolve to the
same font. This is the shaping entry point: shape each run with its
font. A run whose font_id is None has no font in the chain.
Trait Implementations§
Source§impl Clone for FontFallbackChain
impl Clone for FontFallbackChain
Source§fn clone(&self) -> FontFallbackChain
fn clone(&self) -> FontFallbackChain
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more