import type { GlyphInfo } from "../../types.ts"; /** * Indic syllable categories based on Unicode and OpenType spec */ export declare enum IndicCategory { X = 0,// Other/Unknown C = 1,// Consonant V = 2,// Independent vowel N = 3,// Nukta H = 4,// Halant/Virama ZWNJ = 5,// Zero Width Non-Joiner ZWJ = 6,// Zero Width Joiner M = 7,// Matra (dependent vowel) SM = 8,// Syllable modifier (anusvara, visarga) A = 9,// Accent mark VD = 10,// Vedic mark Placeholder = 11,// Placeholder (dotted circle) Dotted_Circle = 12,// Explicit dotted circle RS = 13,// Repha form Coeng = 14,// Coeng (Khmer virama) Ra = 15,// Ra consonant (for repha) CM = 16,// Consonant modifier Symbol = 17,// Symbol CS = 18 } /** * Indic syllabic position */ export declare enum IndicPosition { Start = 0, RaToBecomeReph = 1, PreM = 2, PreC = 3, BaseC = 4, AfterMain = 5, AboveC = 6, BeforeSub = 7, BelowC = 8, AfterSub = 9, BeforePost = 10, PostC = 11, AfterPost = 12, FinalC = 13, SMVD = 14, End = 15 } /** * Per-glyph Indic shaping data */ export interface IndicGlyphData { category: IndicCategory; position: IndicPosition; syllableIndex: number; } /** * Check if a codepoint is an Indic script */ export declare function isIndic(cp: number): boolean; /** * Get the Indic category for a codepoint */ export declare function getIndicCategory(cp: number): IndicCategory; /** * Syllable structure for Indic scripts */ interface Syllable { start: number; end: number; hasReph: boolean; baseConsonant: number; } /** * Find syllable boundaries in the glyph buffer */ export declare function findSyllables(infos: GlyphInfo[]): Syllable[]; /** * Indic feature masks for OpenType features */ export declare const IndicFeatureMask: { readonly nukt: 1; readonly akhn: 2; readonly rphf: 4; readonly rkrf: 8; readonly pref: 16; readonly blwf: 32; readonly abvf: 64; readonly half: 128; readonly pstf: 256; readonly vatu: 512; readonly cjct: 1024; readonly init: 2048; readonly pres: 4096; readonly abvs: 8192; readonly blws: 16384; readonly psts: 32768; }; /** * Matra position in syllable */ export declare enum MatraPosition { PreBase = 0, AboveBase = 1, BelowBase = 2, PostBase = 3 } /** * Get matra position based on codepoint */ export declare function getMatraPosition(cp: number): MatraPosition; /** * Set up masks and syllable indices for Indic shaping */ export declare function setupIndicMasks(infos: GlyphInfo[]): void; /** * Reorder glyphs within a syllable for correct visual display * This handles: * - Moving pre-base matras before the base consonant * - Moving reph to its final position */ export declare function reorderIndic(infos: GlyphInfo[]): void; export {};