# ttfautohint

> TTFAutohint wrapper for Node JS

Latest version **1.3.0** (published 2018-06-15) · MIT license · 0 weekly downloads

## Install

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

Provides the command `ttfautohint`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2018-06-15 |
| First published | 2018-06-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 3 |
| Unpacked size | 12.8 KB |
| Known vulnerabilities | 0 (+4 in 1 direct dependencies) |
| Install scripts | yes |
| GitHub stars | 3 |
| Author | Székely Ádám |
| Maintainers | enteocode |
| Keywords | ttfautohint, stream, font, hint, standalone |

## Links

- npm: https://www.npmjs.com/package/ttfautohint
- Repository: https://github.com/enteocode/node-ttfautohint
- Homepage: https://github.com/enteocode/node-ttfautohint#readme
- Issues: https://github.com/enteocode/node-ttfautohint/issues
- npm.io page: https://npm.io/package/ttfautohint

## Dependencies (3)

- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [rimraf](https://npm.io/package/rimraf.md) ^2.6.2
- [decompress](https://npm.io/package/decompress.md) ^4.2.0

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2018-06-15
- 1.2.0 — 2018-06-14
- 1.1.2 — 2018-06-14
- 1.1.1 — 2018-06-03
- 1.1.0 — 2018-06-02
- 1.0.0 — 2018-06-02

## README

node-ttfautohint  [![Build Status][X]][Y]
================

> TTFAutohint wrapper for Node JS.

### Key Features

- Standalone (no global dependency)
- Stream API
- Compilation process (if no precompiled online)

### Highlights

- Type strict as possible (ESLint)
- ES7
- Functional

## Module Interface

The class implements `stream.Transformer`.

### Install

```bash
$ npm i ttfautohint
```

### Usage

#### Stream API

```javascript
import TTFAutohint from 'ttfautohint';
 
const i = fs.createReadStream('/source/font.ttf');
const o = fs.createWriteStream('/target/font-compiled.ttf');
 
// TTFAutohintOptions can be passed
 
const t = new TTFAutohint();
 
i.pipe(t).pipe(o);
```

#### Buffer API

```javascript
import TTFAutohint from 'ttfautohint';
 
const i = fs.readFileSync('/source/font.ttf');
 
// TTFAutohintOptions can be passed as the second argument
 
const o = TTFAutohint.transform(i);
```

#### File API

```javascript
import TTFAutohint from 'ttfautohint';
  
const i = '/source/font.ttf';
const o = '/target/font.compiled.ttf';
 
// TTFAutohintOptions can be passed as the third argument
 
// If there is no output path provided, then compiles to the source folder 
// with suffix
 
// Creates non-existing target directories
 
TTFAutohint.compile(i, o);
```

### Options

You can configure compilation by an optionally passed `Object` argument.

#### `extended: boolean = false`

Add subglyph adjustment for exotic fonts.

#### `size: number = 16`

The default font-size (x-height) to optimize for.

#### `icon: boolean = false`

For icon-fonts we apply a special font-size metrics and configuration, thus 
if set to `true`, the following options will be ignored:

- `extended`
- `min`
- `max`
- `size`

#### `info: boolean = true`

Add TTFAutohint version string to the name table of the font.

#### `hintingLimit: number = 2048`

Maximum PPEM value.

#### `min: number = 12`

The minimum font-size to optimize for.

#### `max: number = 48`

The maximum font-size to optimize for.

#### `reference: string`

Absolute path to an optional reference TTF/TTC font where missing blue-zones 
can be derived from.

## Console Interface

### Install

```bash
$ npm i -g ttfautohint
```

### Usage

If you install the package globally, NPM will hook it to the `ttfautohint` 
command and you can use it just like the original.

```bash
$ ttfautohint [OPTION]... [IN-FILE [OUT-FILE]]
```

## Configuration

Configuration can be easily changed from your project root, like this:

```bash
$ npm config set ttfautohint:[option] [value]
```

#### `repository: string`

The remote repository where precompiled binaries are come from. Every binary must 
support both `x86` and `x64` architectures and follow this URL pattern:

- `process.platform`
- `npm-config: version`
- `ttfautohint`

Windows binaries must be suffixed by `.exe`.

#### `version: string`

Version of the precompiled TTFAutohint.

#### `force-compile: boolean`

If set to `true`, the install process skips looking for precompiled binaries.

## License

MIT © 2018, [Székely Ádám][Z]


[X]: https://api.travis-ci.com/enteocode/node-ttfautohint.svg?branch=master
[Y]: https://travis-ci.org/enteocode/node-ttfautohint
[Z]: https://github.com/enteocode

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