# webfont

> Generator of fonts from SVG icons; decompress WOFF/WOFF2 to embedded TTF/OTF (not TTF↔OTF transcoding)

Latest version **12.7.0** (published 2026-07-26) · MIT license · 0 weekly downloads

## Install

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

Provides the command `webfont`.

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 12.7.0 |
| Published | 2026-07-26 |
| First published | 2016-07-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=24.14.0 |
| Dependencies | 17 |
| Unpacked size | 251.7 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 308 |
| Author | itgalaxy |
| Maintainers | itgalaxy-owner, evilebottnawi, cap-bernardito, jimmyandrade |
| Keywords | cli, standalone, font, fonts, webfont, webfonts, svg, ttf, woff, woff2, otf, ttf2eot, ttf2woff, ttf2svg, svg2ttf, css, scss, builder, generator |

## Links

- npm: https://www.npmjs.com/package/webfont
- Repository: https://github.com/itgalaxy/webfont
- Homepage: https://github.com/itgalaxy/webfont#readme
- Issues: https://github.com/itgalaxy/webfont/issues
- npm.io page: https://npm.io/package/webfont

## Dependencies (17)

- [meow](https://npm.io/package/meow.md) 14.1.0
- [svgo](https://npm.io/package/svgo.md) 4.0.2
- [globby](https://npm.io/package/globby.md) 16.2.1
- [xml2js](https://npm.io/package/xml2js.md) 0.6.2
- [p-limit](https://npm.io/package/p-limit.md) 7.3.0
- [svg2ttf](https://npm.io/package/svg2ttf.md) ^6.1.0
- [ttf2eot](https://npm.io/package/ttf2eot.md) 3.1.0
- [wawoff2](https://npm.io/package/wawoff2.md) 2.0.1
- [enquirer](https://npm.io/package/enquirer.md) 2.4.1
- [nunjucks](https://npm.io/package/nunjucks.md) 3.2.4
- [ttf2woff](https://npm.io/package/ttf2woff.md) ^3.0.0
- [deepmerge](https://npm.io/package/deepmerge.md) ^4.2.2
- [fontverter](https://npm.io/package/fontverter.md) 2.0.0
- [cosmiconfig](https://npm.io/package/cosmiconfig.md) 9.0.2
- [resolve-from](https://npm.io/package/resolve-from.md) ^5.0.0
- [fonteditor-core](https://npm.io/package/fonteditor-core.md) 2.6.3
- [svgicons2svgfont](https://npm.io/package/svgicons2svgfont.md) ^16.0.0

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 12.7.0 (latest) — 2026-07-26
- 10.0.0-alpha.0 (next) — 2021-01-07
- 12.6.0 — 2026-07-26
- 12.5.0 — 2026-07-07
- 12.4.1 — 2026-07-04
- 12.4.0 — 2026-07-04
- 12.3.0 — 2026-07-04
- 12.2.0 — 2026-07-03
- 12.1.1 — 2026-07-03
- 12.1.0 — 2026-07-03
- 12.0.0 — 2026-07-02
- 11.2.26 — 2021-08-07
- 11.2.20 — 2021-07-31
- 11.2.17 — 2021-07-27
- 11.2.4 — 2021-06-24
- … 40 more at https://npm.io/package/webfont/versions

## README

# webfont

Generator of fonts from SVG icons; decompress WOFF/WOFF2 to embedded TTF/OTF (not TTF↔OTF transcoding).

Requires **Node.js** >= 24.14.0. Use at **build time** only — do not import from browser or React client bundles ([#198](https://github.com/itgalaxy/webfont/issues/198)).

## Install

```shell
npm install --save-dev webfont
```

Add a CLI script (optional):

```json
{
  "scripts": {
    "icons": "webfont 'src/icons/*.svg' -d dist/fonts -t css"
  }
}
```

Full setup (cosmiconfig, verification, first run): **[install.md](./install.md)** · [webfont.js.org/introduction/install](https://webfont.js.org/introduction/install)

## Usage

Use the **named export** (recommended for ESM and CommonJS):

```js
import { webfont } from "webfont";

const result = await webfont({
  files: "src/svg-icons/**/*.svg",
  fontName: "my-font-name",
});
```

CommonJS:

```js
const { webfont } = require("webfont");
```

`import webfont from "webfont"` works on **12.x+** (default export is the function). On older releases use the named import — see [migration notes](https://webfont.js.org/migrating/issue-0618-esm-default-import).

## Pipelines

Each run uses **one** mode (inputs cannot be mixed):

- **SVG icons** (default) — `.svg` → `svg`, `ttf`, `eot`, `woff`, `woff2`
- **TTF encoding** — `.ttf` → `woff`, `woff2`, and optional `svg` / `eot` (auto-detected)
- **Webfont decompress** — `.woff` / `.woff2` (paths, globs, or URLs) → `ttf` and/or `otf` per file

Details and limits: [webfont.js.org/introduction/getting-started](https://webfont.js.org/introduction/getting-started) · [Features](https://webfont.js.org/introduction/features)

## Documentation (shipped with this package)

| Guide | File |
|-------|------|
| Install & CLI wiring | [install.md](./install.md) |
| `webfont()` options & svgicons2svgfont | [docs/configuration.md](./docs/configuration.md) |
| CLI flags & exit codes | [docs/cli.md](./docs/cli.md) |
| Font licensing & legal notices | [NOTICE.md](./NOTICE.md) |

## More documentation

- **Site:** [webfont.js.org](https://webfont.js.org)
- **Repository:** [github.com/itgalaxy/webfont](https://github.com/itgalaxy/webfont)
- **Troubleshooting:** [webfont.js.org/introduction/troubleshooting](https://webfont.js.org/introduction/troubleshooting)
- **Migration:** [webfont.js.org/migrating/](https://webfont.js.org/migrating/)
- **Issues:** [github.com/itgalaxy/webfont/issues](https://github.com/itgalaxy/webfont/issues)
- **Changelog:** [webfont.js.org/introduction/whats-new](https://webfont.js.org/introduction/whats-new) · [GitHub](https://github.com/itgalaxy/webfont/blob/master/packages/webfont/CHANGELOG.md)

## License

The **webfont software** is licensed under the [MIT License](./LICENSE). That license does **not** apply to fonts or icons you process with the tool — see [NOTICE.md](./NOTICE.md).

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