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.
https://chinese-font.netlify.app/
Apache License 2.0
446 stars 16 forks source link

CLI 支持 #25

Closed richex-cn closed 11 months ago

richex-cn commented 11 months ago

可以考虑通过全局安装实现 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
richex-cn commented 11 months ago

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