# @wfh/font-clip

> Web font file clip tool

Latest version **1.0.2** (published 2020-10-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @wfh/font-clip
pnpm add @wfh/font-clip
yarn add @wfh/font-clip
bun add @wfh/font-clip
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-10-12 |
| First published | 2020-09-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | liujing.break@163.com |
| Maintainers | liujingbreak |
| Keywords | font, webfont, icon, iconfont, font-face, compress, minify, font-cli, otf, ttf, woff, eot, svg, ttf2eot, ttf2woff, ttf2svg, svg2ttf, css, base64 |

## Links

- npm: https://www.npmjs.com/package/@wfh/font-clip
- Homepage: https://gitee.com/liujingbreak/@wfh/plink/tree/master/src/internal/font-clip
- npm.io page: https://npm.io/package/@wfh/font-clip

## Dependencies (3)

- [fs-extra](https://npm.io/package/fs-extra.md) ^5.0.0
- [iconv-lite](https://npm.io/package/iconv-lite.md) ~0.5.0
- [fonteditor-core](https://npm.io/package/fonteditor-core.md) 2.0.4

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads
- [@react-md/material-icons](https://npm.io/package/@react-md/material-icons.md) — 1.6K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2020-10-12
- 1.0.1 — 2020-09-27

## README

# Web font file clip tool

Base on fonteditor-core.

- Convert font file format from ttf, eof, otf, svg to woff, woff2
- Clip and minimize font file to only contain specific character subset, compress to woff2 format

```ts
import {clipToWoff2} from 'font-clip';

async function main() {
  const src = Path.resolve('node_modules/font-clip/example-font/PingFang Regular.ttf');
  await clipToWoff2(src, Path.resolve('gen'), '部分中文字'));
  // Output to file gen/PingFang Regular.woff2
}
```

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