import { type DataWriter } from '../data-writer.ts'; import { TableBuilder } from '../table-builder.ts'; /** * Name IDs as per the OpenType specification. */ export declare const NameIDs: { readonly copyrightNotice: 0; readonly fontFamilyName: 1; readonly fontSubfamilyName: 2; readonly uniqueFontIdentifier: 3; readonly fullFontName: 4; readonly versionString: 5; readonly postscriptName: 6; readonly trademark: 7; readonly manufacturerName: 8; readonly designer: 9; readonly description: 10; readonly urlVendor: 11; readonly urlDesigner: 12; readonly licenseDescription: 13; readonly licenseInfoURL: 14; readonly reserved: 15; readonly typographicFamilyName: 16; readonly typographicSubfamilyName: 17; readonly compatibleFullName: 18; readonly sampleText: 19; readonly postscriptCIDFindfontName: 20; readonly wwsFamilyName: 21; readonly wwsSubfamilyName: 22; readonly lightBackgroundPalette: 23; readonly darkBackgroundPalette: 24; readonly variationsPostscriptNamePrefix: 25; }; /** * A record in the 'name' table. */ export type NameRecord = { /** Platform ID. */ readonly platformID: number; /** The platform-specific encoding ID. */ readonly encodingID: number; /** Language ID. */ readonly languageID: number; /** Name ID. */ readonly nameID: number; /** The BCP-47 language code of the name string. */ readonly language: string | undefined; /** The encoding used for the name string. */ readonly encoding: string | undefined; /** Reads the name string. */ readonly readName: () => string; }; /** * The 'name' table contains human-readable strings for various font properties. */ export declare class NameTable { private readonly data; private readonly storageOffset; private readonly langTags; /** The version of the 'name' table. */ readonly version: number; /** The name records in the 'name' table. */ readonly nameRecords: ReadonlyArray; /** * Reads a 'name' table from the given DataView. */ static read(data: DataView): NameTable; private constructor(); /** * Finds a name string for the given name ID, preferring English if available. */ findName(nameID: number): { name: string; language?: string; } | undefined; /** * Finds the best matching name record for the given name ID, preferring English if available. */ private findBestNameRecord; private readNameRecord; private readString; } /** * Builder for the 'name' table. */ export declare class NameTableBuilder extends TableBuilder { private readonly records; private langTags?; constructor(); /** * Adds a name record to the 'name' table. */ addName(nameID: number, string: string, language: string): this; writeTable(writer: DataWriter): void; }