Socket
Book a DemoInstallSign in
Socket

fontmachine

Package Overview
Dependencies
Maintainers
43
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fontmachine

Make GL-ready pbfs and metadata for usage in fontstack API.

latest
npmnpm
Version
0.2.0
Version published
Weekly downloads
1
-75%
Maintainers
43
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 04 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts