Expand description
Contextual and chained contextual subtables, shared by GSUB and GPOS.
A contextual subtable is a chained one without backtrack or lookahead,
so both run through the same walks. Only the layout of their rules
differs, which RuleLayout records: whether they are chained, and the
width of the offsets to them, which the extended formats widen.
Rule values are glyph IDs or classes. The rule walks take their width as a constant, since they read many values per rule: classes are always 16 bits, and only the glyph rules of the extended formats are 24.
StructsΒ§
- Chain
Class πCaches - Caches of the input and lookahead classes of a glyph.
- Chain
Context1 π - Chained context by glyph sequences, or context by glyph sequences.
- Chain
Context2 π - Chained context by glyph class sequences, or context by glyph class sequences.
- Chain
Context3 π - Chained context by a coverage per glyph, or context by a coverage per glyph.
- Chain
Matchers π - How a chain rule matches each of its three sequences.
- Lookahead π
- The glyphs after the current one that rules are pre-matched against.
- Parsed
Rule π - A ruleβs fields, parsed in one pass. Glyph IDs and classes are both
read as plain values of
Wbytes; a sequence rule has no backtrack or lookahead. - Rule
Layout π - How the rules of a subtable are laid out.
- Rule
Probe π - Reads the values of a rule that the pre-match needs, without parsing the rule.
- Rules π
- The rules of a rule set, read on demand from their offsets.
- Syllable
Slot π - Where a glyphβs class is kept in its syllable byte while a lookup
applies: in the bits of
unknownshifted left byshift, where the valueunknownmeans the class isnβt known yet.
EnumsΒ§
- Prematch π
- What the pre-match found after the current glyph.
ConstantsΒ§
- CLASS π
- The width of the class values of a rule, and of the glyph IDs of the original formats.
- GLYPH24 π
- The width of the glyph IDs of the extended formats.
- NARROW π
- The width of glyph IDs, classes and offsets in the original formats.
- WIDE π
- The width of glyph IDs and offsets in the extended formats.
TraitsΒ§
- Matcher π
- Matches a glyph against a rule value in a rule walk.
FunctionsΒ§
- apply_
chain_ πrules - Applies the first rule of a rule set that matches.
- cached_
class π - The class of
gid, remembered incacheif there is one. - finish_
rules π - Marks the range a rule walk depended on, then returns its result.
- for_
each_ πrule - Calls
fwith each rule of each rule set present insets, stopping withNoneat one that canβt be read. - glyph_
seconds π - The glyphs that may follow the first one in a match of a glyph rule.
- matches_
at π - Whether the glyph at
idxmatchesvalue; a glyph outside the buffer never matches. - prematch π
- Finds the glyphs that rules are pre-matched against. The context iterator, unlike the input one, doesnβt skip default ignorables. https://github.com/harfbuzz/harfbuzz/issues/4813
- rule_
first_ πinput - The first input value of a rule, after any backtrack: the second glyph of a match.
- rule_
set π - Rule set
indexofsets, orNoneif it is null or canβt be read. - rule_
set_ πdigests - The digest of the first input class of each rule setβs rules.
- sequence_
matches π - Whether the glyph matches value
indexofsequence. - sequence_
would_ πapply - Whether
inputmatches the glyphs ofctxafter the first. - skip_
rules π - Returns the index of the first rule after
indexwhose first input isnβtfirst. Rules are sorted by it, so the ones skipped would fail the same way; unreadable rules are skipped too. - would_
apply_ πchain_ rules - Whether a rule of
rulesmatches the glyphs ofctx.