# fontmachine

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

Latest version **0.2.0** (published 2017-03-04) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install fontmachine
pnpm add fontmachine
yarn add fontmachine
bun add fontmachine
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2017-03-04 |
| First published | 2015-04-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | aaronlidman, ajashton, amyleew, ansis, arunasank, bergwerkgis, bsudekum, dnomadb, dthompson, emilymcafee, flippmoke, freenerd, gretacb, ian29, ianshward, ingalls, isiyu, jfirebaugh, jrpruit1, karenzshea, kkaefer, lbud, lucaswoj, lxbarth, mapbox-admin, mapsam, mateov, mcwhittemore, miccolis, morganherlocker, mourner, nickidlugash, planemad, rclark, samanbb, sbma44, sgillies, springmeyer, themarex, tmcw, tristen, willwhite, yhahn |

## Links

- npm: https://www.npmjs.com/package/fontmachine
- npm.io page: https://npm.io/package/fontmachine

## Dependencies (2)

- [fontnik](https://npm.io/package/fontnik.md) ~0.5.0
- [queue-async](https://npm.io/package/queue-async.md) ^1.0.7

## Recent versions

- 0.2.0 (latest) — 2017-03-04
- 0.1.2 — 2016-07-28
- 0.1.1 — 2016-01-12
- 0.1.0 — 2015-12-16
- 0.0.3 — 2015-06-30
- 0.0.2 — 2015-04-09
- 0.0.1 — 2015-04-08

## README

# fontmachine

[![NPM](https://nodei.co/npm/fontmachine.png)](https://npmjs.org/package/fontmachine)

[![Build Status](https://travis-ci.org/mapbox/fontmachine.svg?branch=master)](https://travis-ci.org/mapbox/fontmachine)

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: <code>String</code> } | 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](http://nodejs.org/).

```sh
$ npm install fontmachine
```

## Tests

```sh
$ npm test
```

---
_Source: https://npm.io/package/fontmachine · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
