UNPKG

fontjs

Version:

FontJS (Font.js) is a packages for TrueType font parsing and manipulation

137 lines (136 loc) 2.75 kB
import { SeqStream } from "bytestreamjs"; import { FontTable } from "../Table"; export declare enum NameIDs { /** * Copyright notice */ copyright = 0, /** * Font Family name */ fontFamilyName = 1, /** * Font Subfamily name */ fontSubFamilyName = 2, /** * Unique font identifier */ uniqueFontID = 3, /** * Full font name that reflects all family and relevant subfamily descriptors */ fullFontName = 4, /** * Version string */ version = 5, /** * PostScript name for the font */ postScriptFontName = 6, /** * Trademark */ trademark = 7, /** * Manufacturer Name */ manufacturerName = 8, /** * Designer */ designer = 9, /** * Description */ description = 10, /** * URL Vendor */ urlVendor = 11, /** * URL Designer */ urlDesigner = 12, /** * License Description */ licenseDescription = 13, /** * License Info URL */ licenseInfoURL = 14, /** * Typographic Family name */ typographicFamilyName = 16, /** * Typographic Subfamily name */ typographicSubfamilyName = 17, /** * Compatible Full */ compatibleFull = 18, /** * Sample text */ sampleText = 19, /** * PostScript CID findfont name */ postScriptCID = 20, /** * WWS Family Name */ wwsFamilyName = 21, /** * WWS Subfamily Name */ wwsSubfamilyName = 22, /** * Light Background Palette */ lightBackgroundPalette = 23, /** * Dark Background Palette */ darkBackgroundPalette = 24, /** * Variations PostScript Name Prefix */ postScriptNamePrefix = 25 } export interface NameRecordFilter { platformID?: number; platformSpecificID?: number; languageID?: number; } export interface NAMERecord { platformID: number; platformSpecificID: number; languageID: number; nameID: NameIDs; length?: number; offset?: number; value: number[]; } export interface NAMEParameters { format?: number; count?: number; stringOffset?: number; nameRecords?: NAMERecord[]; } export declare class NAME extends FontTable { format: number; count: number; stringOffset: number; nameRecords: NAMERecord[]; constructor(parameters?: NAMEParameters); static get tag(): number; toStream(stream: SeqStream): boolean; static fromStream(stream: SeqStream): NAME; getNameRecord(id: NameIDs, filter?: NameRecordFilter): NAMERecord | null; getName(id: NameIDs, filter?: NameRecordFilter): string | null; }