import type { ClassTable, MorxContextualSubtable, MorxInsertionSubtable, MorxLigatureSubtable, MorxRearrangementSubtable } from "../font/tables/morx.ts"; import type { GlyphId, GlyphInfo } from "../types.ts"; /** * State machine driver for AAT processing */ export interface StateMachineContext { /** Current position in buffer */ pos: number; /** Mark position (for some operations) */ mark: number; /** Glyph stack for ligatures */ stack: number[]; } /** * Get the class value for a glyph from the class table * @param classTable - The class lookup table * @param glyphId - The glyph ID to look up * @returns The class value, or CLASS_OUT_OF_BOUNDS if the glyph is not in the table */ export declare function getGlyphClass(classTable: ClassTable, glyphId: GlyphId): number; /** * Process rearrangement subtable to reorder glyphs based on state machine rules * @param subtable - The rearrangement subtable containing state machine and rules * @param infos - Array of glyph infos to be reordered in place */ export declare function processRearrangement(subtable: MorxRearrangementSubtable, infos: GlyphInfo[]): void; /** * Process contextual substitution subtable to replace glyphs based on context * @param subtable - The contextual subtable containing state machine and substitution tables * @param infos - Array of glyph infos to be modified in place with contextual substitutions */ export declare function processContextual(subtable: MorxContextualSubtable, infos: GlyphInfo[]): void; /** * Process ligature subtable to combine multiple glyphs into ligatures * @param subtable - The ligature subtable containing state machine, actions, and component tables * @param infos - Array of glyph infos to process * @returns New array of glyph infos with ligatures applied and component glyphs removed */ export declare function processLigature(subtable: MorxLigatureSubtable, infos: GlyphInfo[]): GlyphInfo[]; /** * Process insertion subtable to insert additional glyphs before or after existing glyphs * @param subtable - The insertion subtable containing state machine and insertion glyph table * @param infos - Array of glyph infos to process * @returns New array of glyph infos with inserted glyphs added at specified positions */ export declare function processInsertion(subtable: MorxInsertionSubtable, infos: GlyphInfo[]): GlyphInfo[];