Skip to main content

Module lookup

Module lookup 

Source
Expand description

The lookups of GSUB and GPOS, parsed once and kept with the font tables.

When a lookup is first used, each of its subtables is read into a CachedSubtableKind that holds the parsed table together with everything derived from it: coverage and class tables, digests and glyph lookup caches. Applying a subtable is then one indirect call through CachedSubtable that checks the kind it expects and runs.

The parsed tables borrow the font data, so a lookup is kept in a yoke::Yoke with a reference to the font’s shared tables; see CachedLookupRef.

ModulesΒ§

build πŸ”’
Reading a lookup and deriving the data its subtables apply with.
context πŸ”’
Contextual and chained contextual subtables, shared by GSUB and GPOS.
coverage πŸ”’
Coverage and class definition tables, reduced to the arrays they search.
gpos πŸ”’
Positioning subtables.
gsub πŸ”’
Substitution subtables.

MacrosΒ§

kind_fns πŸ”’
The functions of a kind that applies plainly, adjusts pairs, or keeps classes in the glyph-info cache.
kind_payload πŸ”’
The payload of a kind, boxed if the kind is marked so.
subtable_kinds πŸ”’
Declares the subtable kinds, the data each holds, and how it applies.
wrap_payload πŸ”’

StructsΒ§

CachedLookup
A lookup with its subtables parsed.
CachedSubtable πŸ”’
A parsed subtable and the functions that apply it.
KindFns πŸ”’
How a kind of subtable applies.
LookupCache πŸ”’
The lookups of GSUB or GPOS, each parsed on first use.
Offsets πŸ”’
An array of offsets to child tables, with the data they are relative to.
Uints πŸ”’
Big-endian unsigned integers of one width, two or three bytes, read from an array in place. Glyph IDs, offsets and rule values of the original and extended formats share code through it.
Values πŸ”’
Unsigned integers of W bytes, read in place: glyph IDs, classes or offsets whose width a hot path fixes at compile time.

EnumsΒ§

CachedSubtableKind πŸ”’
A parsed subtable with the data derived from it.

TraitsΒ§

IntoKind πŸ”’
The derived data of one kind of subtable.
SubtableDigests πŸ”’
What a lookup needs to know about one of its subtables.

FunctionsΒ§

be_uint πŸ”’
The big-endian unsigned integer of two to four bytes.
be_value πŸ”’
The big-endian value of W bytes, two or three.
cache_lookup πŸ”’
Parses lookup index of GSUB, or GPOS if is_subst is false.
cache_synthesized_subst πŸ”’
Parses a substitution lookup serialized on its own, as the Arabic fallback makes them.
coverage_index_cached πŸ”’
Returns the coverage index of gid, remembering it in cache.
glyph_class_cached πŸ”’
Returns the class of gid, remembering it in cache.
glyph_class_uncached πŸ”’
Looks up a class the cache doesn’t hold, and remembers it. Kept out of line so callers inline only the cache hit.
never_shares πŸ”’
The apply_sharing of kinds that don’t adjust pairs, which no walk calls.
read_be πŸ”’
The big-endian unsigned integer of W bytes at pos, or None if it is out of bounds.
read_uint πŸ”’
The unsigned integer of width bytes at pos, which the caller has checked is in bounds.
walk_each πŸ”’
Applies subtables in turn.
walk_sharing_second_glyph πŸ”’
Applies subtables that adjust pairs, searching for the second glyph of the pair at most once for all of them.
walk_single πŸ”’
Applies a lookup’s only subtable. Its digest equals the lookup’s, which the caller has already tested.

Type AliasesΒ§

ApplyFn πŸ”’
Applies a subtable of one kind at the given coverage index, returning None for any other kind.
ApplySharingFn πŸ”’
Applies a subtable of one kind, sharing the search for a pair’s second glyph with the other subtables of its lookup.
CachedLookupRef πŸ”’
A cached lookup kept with the data it borrows: the font’s tables, or the bytes of a lookup made up for a font that lacks one.
WalkFn πŸ”’
Applies the subtables of a lookup until one applies.