import { ByteArray } from '../../types.js'; import { FontDescriptor, TtfFontInfo, FontParser } from '../types.js'; /** * Parses OpenType font files (.otf) to extract metrics and glyph widths. * Supports both CFF-based and TrueType-based OpenType fonts. * * Note: OTF files share the same table structure as TTF for metrics, * the main difference is the glyph outline format (CFF vs TrueType). */ export declare class OtfParser implements FontParser { private data; private tables; private isCFF; constructor(fontData: ByteArray); /** * Returns the original font bytes. */ getFontData(): ByteArray; private parseTables; private readTag; private getTable; /** * Returns true if this is a CFF-based OpenType font. */ isCFFBased(): boolean; /** * Parses the font and returns basic font information. */ getFontInfo(): TtfFontInfo; /** * Creates a FontDescriptor suitable for embedding. * Scales metrics to PDF's 1000-unit em square. */ getFontDescriptor(fontName?: string): FontDescriptor; /** * Gets character widths for a range of characters. */ getCharWidths(firstChar: number, lastChar: number): number[]; private parseHead; private parseHhea; private parseOS2; private parsePost; private parseName; parseCmap(): Map; private parseCmapFormat4; private parseCmapFormat12; parseHmtx(): Map; private parseMaxp; private estimateStemV; } export declare function estimateStemVFromWeight(weightClass: number): number;