Make GL-ready pbfs and metadata for usage in fontstack API.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test fix glyph-pbf-composite require Mar 4, 2017
.gitignore call callback with error instead of throwing on multiface font Jul 28, 2016
.npmignore
.travis.yml only test on node v4/5 Mar 3, 2017
CHANGELOG.md
LICENSE add license title Jul 16, 2016
LICENSE.txt
README.md
index.js
package-lock.json 0.2.2 Dec 10, 2018
package.json

README.md

fontmachine

NPM

Build Status

Make GL-ready PBFs and metadata for use in glyphs API.

Usage

makeGlyphs(opts, callback)

Make all metadata (codepoints) and SDF PBFs necessary for Mapbox GL fontstacks.

Parameters

parameter type description
opts { font: Buffer, filetype: String } An object with a font file and its file type (e.g. .ttf).
callback Function Callback should take arguments (error, result).

Returns Object, font An object containing all files and data.

  • {String} font.fontname The name of this font (concatenated family_name + style_name).
  • {Array} font.stack An array of {name: filename, data: buffer} objects with SDF PBFs covering points 0-65535.
  • {Object} font.metadata An object where data is a stringified codepoints result.
  • {Object} font.original An object containing the original font file (named "original{.filetype}")

Installation

Requires nodejs.

$ npm install @mapbox/fontmachine

Tests

$ npm test