/** * Standard Font Metrics — shared between Word layout and PDF rendering. * * Provides width data for the 14 standard PDF fonts (Helvetica, Times, Courier families). * Used for text measurement without requiring actual font files. * * Character widths are specified in 1/1000 of a text unit. To get the actual width * of a character at a given font size: * width_in_points = (charWidth / 1000) * fontSize * * @see PDF Reference 1.7, Appendix D - Standard Type 1 Fonts * @see Adobe Font Metrics files (AFM) for canonical widths */ /** * Get the width of a character in a given font. * @param charCode - Unicode code point (or char code) * @param fontName - PDF standard font name * @returns Width in thousandths of a unit */ export declare function getCharWidth(charCode: number, fontName: string): number; /** * Measure the width of a text string in the given font and size. * @param text - The string to measure * @param fontName - PDF standard font name * @param fontSize - Font size in points * @returns Width in points */ export declare function measureTextWidth(text: string, fontName: string, fontSize: number): number; /** * Get the font ascent for a given font and size. * @param fontName - PDF standard font name * @param fontSize - Font size in points * @returns Ascent in points (positive, distance above baseline) */ export declare function getFontAscent(fontName: string, fontSize: number): number; /** * Get the font descent for a given font and size. * @param fontName - PDF standard font name * @param fontSize - Font size in points * @returns Descent in points (positive value representing distance below baseline) */ export declare function getFontDescent(fontName: string, fontSize: number): number; /** * Get the total line height (ascent - descent) for a font. * @param fontName - PDF standard font name * @param fontSize - Font size in points * @returns Line height in points */ export declare function getLineHeight(fontName: string, fontSize: number): number; /** * Check if a font name is a known standard PDF font. */ export declare function isStandardFont(fontName: string): boolean; /** * Get all supported standard font names. */ export declare function getStandardFontNames(): string[]; /** * Map common font names (like "Arial", "Calibri") to closest standard font. * Returns the input unchanged if it's already a standard font name. * Falls back to "Helvetica" for unknown fonts. */ export declare function mapToStandardFont(fontName: string): string; /** * Given a standard PDF base font and bold/italic flags, return the matching * metric variant name (e.g. "Helvetica" + bold → "Helvetica-Bold"). This keeps * width measurement consistent with the glyphs that are actually drawn, so * bold/italic runs are measured with their true (wider) metrics rather than * the regular ones. Falls back to the base name when a variant is unknown. */ export declare function styledFontVariant(baseFont: string, bold?: boolean, italic?: boolean): string;