Skip to main content

Module fallback

Module fallback 

Source
Expand description

Precomputed font fallback chains for resolving font stacks.

A FontFallbackChain is a self-contained snapshot that maps a CSS font stack to the exact fonts that will be used for any character, without requiring further metadata lookups during layout.

Resolution order:

  1. The CSS stack in order.
  2. The script fallback group whose block contains the character.
  3. The configured last resort, without a coverage check.

Structs§

CssFallbackGroup
The fonts one entry of the CSS font stack resolved to.
FontFallbackChain
A resolved font fallback chain for one CSS font stack and style.
RankKey
The ordering used wherever font candidates compete. Smaller is better.
ScriptFallbackGroup
Fonts to try for characters inside one Unicode block, best first.

Constants§

LAST_RESORT_SOURCE
css_source reported by FontFallbackChain::resolve_char for the configured last resort.
MAX_AUTO_FALLBACKS_PER_SCRIPT
How many coverage-ranked fonts a script fallback group keeps beyond the configured preferences.
MAX_FACES_PER_FAMILY
How many faces of one family a chain keeps (Regular, Bold, Italic, … ranked by closeness to the requested style).
UNICODE_FALLBACK_SOURCE
css_source reported by FontFallbackChain::resolve_char for a font taken from FontFallbackChain::unicode_fallbacks.

Functions§

breadth
Total coverage in codepoints.
covers
Returns true if ranges contains cp. ranges must be sorted and disjoint.
overlap_size
Number of codepoints in block that ranges cover, capped at the block’s width.
range_width
Width of a range in codepoints.