UNPKG

fontjs

Version:

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

141 lines (140 loc) 3.74 kB
import { SeqStream } from "bytestreamjs"; import { FontTable } from "../Table"; import { Glyph } from "./GLYF"; export interface MAXPParameters { /** * Version */ version?: number; /** * The number of glyphs in the font */ numGlyphs?: number; /** * Maximum points in a non-composite glyph */ maxPoints?: number; /** * Maximum contours in a non-composite glyph */ maxContours?: number; /** * Maximum points in a composite glyph */ maxComponentPoints?: number; /** * Maximum contours in a composite glyph */ maxComponentContours?: number; /** * 1 if instructions do not use the twilight zone (Z0), or 2 if instructions do use Z0; should be set to 2 in most cases */ maxZones?: number; /** * Maximum points used in Z0 */ maxTwilightPoints?: number; /** * Number of Storage Area locations */ maxStorage?: number; /** * Number of FDEFs, equal to the highest function number + 1 */ maxFunctionDefs?: number; /** * Number of IDEFs */ maxInstructionDefs?: number; /** * Maximum stack depth across Font Program ('fpgm' table), CVT Program ('prep' table) and all glyph instructions (in the 'glyf' table) */ maxStackElements?: number; /** * Maximum byte count for glyph instructions */ maxSizeOfInstructions?: number; /** * Maximum number of components referenced at “top level” for any composite glyph */ maxComponentElements?: number; /** * Maximum levels of recursion; 1 for simple components */ maxComponentDepth?: number; glyphs?: Glyph[]; } /** * Represents MAXP table. This table establishes the memory requirements for this font * @see https://docs.microsoft.com/en-us/typography/opentype/spec/maxp */ export declare class MAXP extends FontTable { /** * Version */ version: number; /** * The number of glyphs in the font */ numGlyphs: number; /** * Maximum points in a non-composite glyph */ maxPoints?: number; /** * Maximum contours in a non-composite glyph */ maxContours?: number; /** * Maximum points in a composite glyph */ maxComponentPoints?: number; /** * Maximum contours in a composite glyph */ maxComponentContours?: number; /** * 1 if instructions do not use the twilight zone (Z0), or 2 if instructions do use Z0; should be set to 2 in most cases */ maxZones?: number; /** * Maximum points used in Z0 */ maxTwilightPoints?: number; /** * Number of Storage Area locations */ maxStorage?: number; /** * Number of FDEFs, equal to the highest function number + 1 */ maxFunctionDefs?: number; /** * Number of IDEFs */ maxInstructionDefs?: number; /** * Maximum stack depth across Font Program ('fpgm' table), CVT Program ('prep' table) and all glyph instructions (in the 'glyf' table) */ maxStackElements?: number; /** * Maximum byte count for glyph instructions */ maxSizeOfInstructions?: number; /** * Maximum number of components referenced at “top level” for any composite glyph */ maxComponentElements?: number; /** * Maximum levels of recursion; 1 for simple components */ maxComponentDepth?: number; constructor(parameters?: MAXPParameters); static get tag(): number; /** * Construct MAXP table from array of glyphs */ fromGlyphs(glyphs: Glyph[]): void; toStream(stream: SeqStream): boolean; static fromStream(stream: SeqStream): MAXP; }