UNPKG

cn-font-split

Version:

划时代的字体切割工具,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.

2 lines 2.23 kB
let e=require("commander"),t=require("proto-to-cli/dist/parser.js");var n=new e.Command(`run`);n.requiredOption(`-i,--input <bytes>`,`ttf/woff2 文件的 buffer`,t.toFile).option(`-o,--outDir <string>`,`切割后放置文件的文件夹`).option(`--css.fontFamily <string>`,`字体家族名称`).option(`--css.fontWeight <string>`,`字体粗细`).option(`--css.fontStyle <string>`,`字体样式`).option(`--css.fontDisplay <string>`,`字体显示方式`).option(`--css.localFamily <string>`,`本地字体家族名称`).option(`--polyfill.name <string>`,`名称`).option(`--polyfill.format <string>`,`格式`).option(`--css.commentBase <bool>`,`基础注释`,t.toBoolean).option(`--css.commentNameTable <bool>`,`名称表注释`,t.toBoolean).option(`--css.commentUnicodes <bool>`,`Unicode 注释`,t.toBoolean).option(`--css.compress <bool>`,`是否压缩`,t.toBoolean).option(`--css.fileName <string>`,`文件名`).option(`-t,--targetType <string>`,`目标类型`).option(`-s,--subsets <bytes>`,`子集`,(0,t.HandleRepeated)(t.toFile)).option(`-c,--chunkSize <int32>`,`包大小`,t.toInt).option(`--chunkSizeTolerance <float>`,`包大小容差`,t.toFloat).option(`-m,--maxAllowSubsetsCount <int32>`,`最大允许子集数量`,t.toInt).option(`--testHtml <bool>`,`是否生成测试 HTML`,t.toBoolean).option(`-r,--reporter <bool>`,`是否生成 reporter.bin`,t.toBoolean).option(`--previewImage.text <string>`,`会显示在 svg 中的文本`).option(`--previewImage.name <string>`,`svg 文件的名称`).option(`--renameOutputFont <string>`,`重命名输出字体`).option(`-b,--buildMode <string>`,`TODO 构建模式`).option(`-l,--languageAreas <bool>`,`是否进行语言区域优化`,t.toBoolean).option(`--multiThreads <bool>`,`TODO 是否使用多线程`,t.toBoolean).option(`-f,--fontFeature <bool>`,`是否启用字体特性`,t.toBoolean).option(`--reduceMins <bool>`,`是否减少最小分包,`,t.toBoolean).option(`-a,--autoSubset <bool>`,`是否自动子集化`,t.toBoolean).option(`--subsetRemainChars <bool>`,`是否自动添加没有声明的字符`,t.toBoolean);var r=(t,r)=>{let i=new e.Command;return i.addCommand(n,{isDefault:!0}),r&&r(i,n),i.parse(t)};exports.getCliParams=r; //# sourceMappingURL=proto.js.map