import type { GlyphId, Tag, Variation } from "../types.ts"; import type { Font } from "./font.ts"; import { type VariationAxis } from "./tables/fvar.ts"; /** * A Face represents a specific instance of a variable font. * For non-variable fonts, it simply wraps the Font. */ export declare class Face { readonly font: Font; /** Normalized axis coordinates [-1, 1] */ private _coords; /** User-space axis values */ private _variations; /** Cached advance width deltas for variable fonts (glyphId -> delta) */ private _advanceDeltas; constructor(font: Font, variations?: Record | Variation[]); /** * Set variation axis values * @param variations Object with axis tags as keys (e.g., { wght: 700, wdth: 100 }) * or array of Variation objects */ setVariations(variations: Record | Variation[]): void; /** * Get normalized coordinates for variation processing */ get normalizedCoords(): number[]; /** * Check if this is a variable font instance */ get isVariable(): boolean; /** * Get variation axes */ get axes(): VariationAxis[]; /** * Get current value for an axis */ getAxisValue(axisTag: Tag | string): number | null; /** * Get advance width for a glyph, including variation deltas */ advanceWidth(glyphId: GlyphId): number; /** * Get left side bearing for a glyph, including variation deltas */ leftSideBearing(glyphId: GlyphId): number; get numGlyphs(): number; get unitsPerEm(): number; get ascender(): number; get descender(): number; get lineGap(): number; glyphId(codepoint: number): GlyphId; glyphIdForChar(char: string): GlyphId; hasTable(t: Tag): boolean; get gdef(): import("./tables/gdef.ts").GdefTable | null; get gsub(): import("./tables/gsub.ts").GsubTable | null; get gpos(): import("./tables/gpos.ts").GposTable | null; get kern(): import("./tables/kern.ts").KernTable | null; get morx(): import("./tables/morx.ts").MorxTable | null; get cmap(): import("./tables/cmap.ts").CmapTable; get hmtx(): import("./tables/hmtx.ts").HmtxTable; get hhea(): import("./tables/hhea.ts").HheaTable; } /** * Create a face from a font with optional variations */ export declare function createFace(font: Font, variations?: Record | Variation[]): Face;