UNPKG

fontjs

Version:

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

148 lines (147 loc) 3.61 kB
import { SeqStream } from "bytestreamjs"; import { FontTable } from "../Table"; export interface HHEAParameters { /** * version number of the horizontal header table */ version?: number; /** * Typographic ascent */ ascent?: number; /** * Typographic descent */ descent?: number; /** * Typographic line gap */ lineGap?: number; /** * Maximum advance width value in 'hmtx' table */ advanceWidthMax?: number; /** * Minimum left sidebearing value in 'hmtx' table for glyphs with contours (empty glyphs should be ignored) */ minLeftSideBearing?: number; /** * Minimum right sidebearing value; calculated as min(aw - (lsb + xMax - xMin)) for glyphs with contours (empty glyphs should be ignored) */ minRightSideBearing?: number; /** * Max(lsb + (xMax - xMin)) */ xMaxExtent?: number; /** * Used to calculate the slope of the cursor (rise/run); 1 for vertical */ caretSlopeRise?: number; /** * 0 for vertical */ caretSlopeRun?: number; /** * The amount by which a slanted highlight on a glyph needs to be shifted to produce the best appearance. Set to 0 for non-slanted fonts */ caretOffset?: number; /** * set to 0 */ reserved1?: number; /** * set to 0 */ reserved2?: number; /** * set to 0 */ reserved3?: number; /** * set to 0 */ reserved4?: number; /** * 0 for current format */ metricDataFormat?: number; /** * Number of hMetric entries in 'hmtx' table */ numOfLongHorMetrics?: number; } /** * Representation of HEAD table. Horizontal Header Table. This table contains information for horizontal layout * @see https://docs.microsoft.com/en-us/typography/opentype/spec/hhea */ export declare class HHEA extends FontTable { /** * version number of the horizontal header table */ version: number; /** * Typographic ascent */ ascent: number; /** * Typographic descent */ descent: number; lineGap: number; /** * Maximum advance width value in 'hmtx' table */ advanceWidthMax: number; /** * Minimum left sidebearing value in 'hmtx' table for glyphs with contours (empty glyphs should be ignored) */ minLeftSideBearing: number; /** * Minimum right sidebearing value; calculated as min(aw - (lsb + xMax - xMin)) for glyphs with contours (empty glyphs should be ignored) */ minRightSideBearing: number; /** * Max(lsb + (xMax - xMin)) */ xMaxExtent: number; /** * Used to calculate the slope of the cursor (rise/run); 1 for vertical */ caretSlopeRise: number; /** * 0 for vertical */ caretSlopeRun: number; /** * The amount by which a slanted highlight on a glyph needs to be shifted to produce the best appearance. Set to 0 for non-slanted fonts */ caretOffset: number; /** * set to 0 */ reserved1: number; /** * set to 0 */ reserved2: number; /** * set to 0 */ reserved3: number; /** * set to 0 */ reserved4: number; /** * 0 for current format */ metricDataFormat: number; /** * Number of hMetric entries in 'hmtx' table */ numOfLongHorMetrics: number; constructor(parameters?: HHEAParameters); static get tag(): number; toStream(stream: SeqStream): boolean; static fromStream(stream: SeqStream): HHEA; }