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Β§
- Cached
Lookup - A lookup with its subtables parsed.
- Cached
Subtable π - A parsed subtable and the functions that apply it.
- KindFns π
- How a kind of subtable applies.
- Lookup
Cache π - 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
Wbytes, read in place: glyph IDs, classes or offsets whose width a hot path fixes at compile time.
EnumsΒ§
- Cached
Subtable πKind - A parsed subtable with the data derived from it.
TraitsΒ§
- Into
Kind π - The derived data of one kind of subtable.
- Subtable
Digests π - 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
Wbytes, two or three. - cache_
lookup π - Parses lookup
indexof GSUB, or GPOS ifis_substis 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 incache. - glyph_
class_ πcached - Returns the class of
gid, remembering it incache. - 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_sharingof kinds that donβt adjust pairs, which no walk calls. - read_be π
- The big-endian unsigned integer of
Wbytes atpos, orNoneif it is out of bounds. - read_
uint π - The unsigned integer of
widthbytes atpos, 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
Nonefor any other kind. - Apply
Sharing πFn - Applies a subtable of one kind, sharing the search for a pairβs second glyph with the other subtables of its lookup.
- Cached
Lookup πRef - 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.