KonghaYao / cn-font-split

划时代的字体切割工具,CJK与任何字符!支持 otf、ttf、woff2 字体多线程切割,完美地细颗粒度地进行包大小控制。A revolutionary font subetter that supports CJK and any characters! It enables multi-threaded subset of otf, ttf, and woff2 fonts, allowing for precise control over package size.

Home Page:https://chinese-font.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CLI 支持

richex-cn opened this issue · comments

可以考虑通过全局安装实现 CLI 支持,比起建一个目录然后安装依赖再分包要方便一些。

例如:

$ npm i -g @konghayao/cn-font-split
$ cn-font-split ./SourceHanSerifCN-Bold.ttf # 默认输出到字体文件同名目录 SourceHanSerifCN-Bold/
$ cn-font-split -o ./dist ./SourceHanSerifCN-Bold.ttf # 指定输出目录
$ cn-font-split --chunk-size 70k ./SourceHanSerifCN-Bold.ttf
$ cn-font-split --no-reporter ./SourceHanSerifCN-Bold.ttf
$ cn-font-split --no-html-reporter ./SourceHanSerifCN-Bold.ttf
$ cn-font-split --no-json-reporter ./SourceHanSerifCN-Bold.ttf
$ cn-font-split --chunk-name '[hash:8][ext]' ./SourceHanSerifCN-Bold.ttf

忽略,没注意到已经支持了……