UNPKG

autokerning

Version:

autokerning computes suggested kerning values for glyph pairs from TrueType/OpenType fonts by rendering glyph bitmaps, applying a small Gaussian blur, and measuring pixel overlap across horizontal offsets. It can be used programmatically (as an imported E

14 lines 498 B
import * as opentype from "opentype.js"; import { NdArray } from "ndarray"; /** Represents a rendered glyph as a grayscale matrix */ export interface Glyph { char: string; width: number; height: number; advance: number; bboxOffsetX: number; bitmap: NdArray<Float32Array>; } /** Render a single glyph from the font into a grayscale bitmap with proper bounds */ export declare function renderGlyph(font: opentype.Font, char: string): Glyph; //# sourceMappingURL=glyph.d.ts.map