/** A font as the measurer needs it; sizes are already in CSS pixels. */ export interface LayoutFontSpec { family: string; sizePx: number; bold?: boolean; italic?: boolean; kerning?: 'normal' | 'none'; ligatures?: import('../ligatures.js').Ligatures; smallCaps?: boolean; } /** Injectable text measurer: a host supplies canvas or font tables, tests use the fake below. The engine never touches the DOM. */ export interface TextMeasurer { /** Glyph width in CSS pixels, including the requested kerning mode, before scale/spacing. */ widthOf(text: string, font: LayoutFontSpec): number; /** Natural single-spaced line height for `font`, in CSS pixels (ascent + descent + leading). */ lineHeightOf(font: LayoutFontSpec): number; /** Height above the baseline within that line height; about 80% when not provided. */ ascentOf?(font: LayoutFontSpec): number; } /** A font's ascent and descent (together its single line height), for baseline alignment. */ export declare function fontMetrics(measurer: TextMeasurer, font: LayoutFontSpec): { ascent: number; descent: number; }; /** * Deterministic measurer for unit tests: fixed per-character advance and line * height derived only from font size, so line-breaking and pagination tests * never depend on host font metrics or canvas availability. */ export declare function createFakeMeasurer(options?: { charWidthFactor?: number; lineHeightFactor?: number; }): TextMeasurer; //# sourceMappingURL=measure.d.ts.map