
For collection fonts (such as TrueType collection files), you can pass a postscriptName to get that font out of the collection instead of a collection object. Returns a font object for the given buffer. fontkit.create(buffer, postscriptName = null) Opens a font file synchronously, and returns a font object. fontkit.openSync(filename, postscriptName = null) Opens a font file asynchronously, and calls the callback with a font object. createWriteStream ( 'subset.ttf' ) ) API fontkit.open(filename, postscriptName = null, callback(err, font)) toSVG ( ) // create a font subset var subset = font. layout ( 'hello world!' ) // get an SVG path for a glyph var svg = run. returns a GlyphRun, describing glyphs and positions. openSync ( 'font.ttf' ) // layout a string, using default shaping features. Var fontkit = require ( 'fontkit' ) // open a font synchronously var font = fontkit. Font subsetting support - create a new font including only the specified glyphs.Support for AAT variation glyphs, allowing for nearly infinite design control over weight, width, and other axes.emoji), including Apple’s SBIX table, and Microsoft’s COLR table Supports TrueType (glyf) and PostScript (CFF) outlines.Support for getting glyph vector paths and converting them to SVG paths, or rendering them to a graphics context.


It supports many font formats, advanced glyph substitution and layout features, glyph path extraction, color emoji glyphs, font subsetting, and more. Fontkit is an advanced font engine for Node and the browser, used by PDFKit.
