fontjs
Version:
FontJS (Font.js) is a packages for TrueType font parsing and manipulation
47 lines (46 loc) • 1.52 kB
TypeScript
import { SeqStream } from "bytestreamjs";
import { FontTable } from "../Table";
export interface HMTXMetrix {
/**
* Advance width, in font design units
*/
advanceWidth: number;
/**
* Glyph left side bearing, in font design units
*/
leftSideBearing: number;
}
export interface HMTXParameters {
/**
* Paired advance width and left side bearing values for each glyph. Records are indexed by glyph ID
*/
hMetrics?: HMTXMetrix[];
/**
* Left side bearings for glyph IDs greater than or equal to numberOfHMetrics
*/
leftSideBearings?: number[];
}
/**
* Represents HMTX table. Horizontal Metrics Table
* @see https://docs.microsoft.com/en-us/typography/opentype/spec/hmtx
*/
export declare class HMTX extends FontTable {
/**
* Paired advance width and left side bearing values for each glyph. Records are indexed by glyph ID
*/
hMetrics: HMTXMetrix[];
/**
* Left side bearings for glyph IDs greater than or equal to numberOfHMetrics
*/
leftSideBearings: number[];
constructor(parameters?: HMTXParameters);
static get tag(): number;
toStream(stream: SeqStream): boolean;
/**
* Convert SeqStream data to object
* @param stream
* @param numGlyphs The value is found in the 'maxp' table
* @param numOfLongHorMetrics The value is found in the 'hhea' (Horizontal Header) table
*/
static fromStream(stream: SeqStream, numGlyphs: number, numOfLongHorMetrics: number): HMTX;
}