/** * Per-glyph atlas record. UV coordinates are in [0..1] over the atlas; size / * advance / baseline are in canvas pixels (atlas reference frame). World-space * scaling happens in the text pipeline based on the IFC text height attribute. */ export interface GlyphInfo { u0: number; v0: number; u1: number; v1: number; /** Glyph quad width in atlas pixels (excludes padding). */ widthPx: number; /** Glyph quad height in atlas pixels (excludes padding). */ heightPx: number; /** Horizontal advance (pen movement) in atlas pixels. */ advancePx: number; /** Distance from the rendered quad's top edge to the baseline, in atlas pixels. */ baselinePx: number; } export interface GlyphAtlasOptions { /** Width/height of the backing canvas (square). Defaults to 1024. */ atlasSize?: number; /** Cap height of rendered glyphs in canvas pixels. Defaults to 48. */ glyphPx?: number; /** CSS font-family string. Defaults to a permissive system-font stack. */ fontFamily?: string; } export declare class SymbolicTextAtlas { readonly canvas: HTMLCanvasElement; readonly atlasSize: number; readonly glyphPx: number; readonly rowHeight: number; /** Distance from glyph top to baseline, constant for the chosen font size. */ readonly baselinePx: number; private readonly ctx; private readonly glyphs; private cursorX; private cursorY; private version; constructor(opts?: GlyphAtlasOptions); /** Bumps each time a new glyph is rasterised so the renderer knows to re-upload. */ getVersion(): number; /** * Get or lazily rasterise a glyph. Returns `null` when the atlas is full — * callers should fall back to a missing-glyph quad (typically the space * character or a small box). */ getOrAddGlyph(char: string): GlyphInfo | null; /** * Layout a UTF-16 string against the atlas. Code points outside the BMP are * passed through as surrogate pairs which Canvas2D renders correctly. Empty * advance entries are emitted for missing glyphs so the layout cursor still * progresses. * * `out` is filled with one record per code point. Returns the total advance * width in atlas pixels (caller uses this for alignment). */ layoutString(s: string): { glyphs: GlyphLayoutEntry[]; totalAdvancePx: number; }; } export interface GlyphLayoutEntry { /** Pen position (in atlas pixels) where this glyph's left edge sits. */ xOffsetPx: number; glyph: GlyphInfo; } //# sourceMappingURL=symbolic-text-atlas.d.ts.map