0.2.0 • Published 7 years ago

fontmachine v0.2.0

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

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

parametertypedescription
opts{ font: Buffer, filetype: String }An object with a font file and its file type (e.g. .ttf).
callbackFunctionCallback 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 fontmachine

Tests

$ npm test
0.2.0

7 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago