font-pack
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Font Pack

npm

A tool helps to generate ttf, woff, woff2 and css file at the same time. Supports splitting font files on demand.

一个可以根据常用字体格式文件,直接生成 ttf、woff 和 woff2 字体文件、以及包含该字体font-face定义的 css 文件。同时可以根据需要的字符集裁剪字体文件,实现类似font-spider的功能。

Usage

Only generate web font

npx font-pack test.ttf -o dist

Output Files:

dist/test.css
dist/test.tff
dist/test.woff
dist/test.woff2

Split font file

This will generate two font files, one only contain the charset required, and the other contains the rest charset of the font itself.

npx font-pack test.ttf --split-name test2 --split-chars abcdefg1234567

Output Files:

dist/test.css
dist/test.tff
dist/test.woff
dist/test.woff2
dist/test2.css
dist/test2.tff
dist/test2.woff
dist/test2.woff2

Acknowledgement

License

MIT License. See here for details.

Package Sidebar

Install

npm i font-pack

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

4.17 MB

Total Files

8

Last publish

Collaborators

  • gydi