# woff-tools

> Node.js font converter capable of converting SFNT ([TrueType](https://en.wikipedia.org/wiki/TrueType), [OpenType](https://en.wikipedia.org/wiki/OpenType)) font files to [WOFF](https://en.wikipedia.org/wiki/Web_Open_Font_Format) and vice-versa.

Latest version **0.1.0** (published 2020-11-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install woff-tools
pnpm add woff-tools
yarn add woff-tools
bun add woff-tools
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2020-11-12 |
| First published | 2020-11-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 17.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Onur Demiralay |
| Maintainers | tbjgolden |

## Links

- npm: https://www.npmjs.com/package/woff-tools
- Repository: https://github.com/tbjgolden/woff2sfnt-sfnt2woff
- npm.io page: https://npm.io/package/woff-tools

## Dependencies (1)

- [pako](https://npm.io/package/pako.md) ^1.0.11

## Recent versions

- 0.1.0 (latest) — 2020-11-12

## README

# `woff-tools` | OTF to WOFF / WOFF to OTF / TTF to WOFF / WOFF to TTF

Node.js font converter capable of converting SFNT ([TrueType](https://en.wikipedia.org/wiki/TrueType), [OpenType](https://en.wikipedia.org/wiki/OpenType)) font files to [WOFF](https://en.wikipedia.org/wiki/Web_Open_Font_Format) and vice-versa.

Forked from https://github.com/odemiral/woff2sfnt-sfnt2woff and added some clearer documentation, a package.json and added to npm.

> `woff2sfnt-sfnt2woff` is based on an Ubuntu package `woff-tools`, which contains the two commands woff2sfnt and sfnt2woff. As far as I can find, this Ubuntu package is the original package released with `woff` by Mozilla.

## Usage

### CLI

```sh
# Convert from ttf to woff
node sfnt2woff.js input.ttf output.woff
# Convert from otf to woff
node sfnt2woff.js input.otf output.woff
```

```sh
# Convert from woff to ttf
node woff2sfnt.js input.woff output.ttf
# Convert from woff to otf
node woff2sfnt.js input.woff output.otf
```

### API

```js
// ttf to woff
const { toWoff } = require("woff-tools");
const fs = require("fs");

fs.writeFileSync("output.woff", toWoff(fs.readFileSync("input.ttf")));
```

```js
// woff to ttf
const { toSfnt } = require("woff-tools");
const fs = require("fs");

fs.writeFileSync("output.ttf", toSfnt(fs.readFileSync("input.woff")));
```

## License

MIT License

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