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.
3 lines (2 loc) • 2.31 kB
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("proto-to-cli/dist/parser.js"),i=require("commander"),n=new i.Command("run");n.requiredOption("-i,--input <bytes>","ttf/woff2 文件的 buffer",o.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>","基础注释",o.toBoolean).option("--css.commentNameTable <bool>","名称表注释",o.toBoolean).option("--css.commentUnicodes <bool>","Unicode 注释",o.toBoolean).option("--css.compress <bool>","是否压缩",o.toBoolean).option("--css.fileName <string>","文件名").option("-t,--targetType <string>","目标类型").option("-s,--subsets <bytes>","子集",o.HandleRepeated(o.toFile)).option("-c,--chunkSize <int32>","包大小",o.toInt).option("--chunkSizeTolerance <float>","包大小容差",o.toFloat).option("-m,--maxAllowSubsetsCount <int32>","最大允许子集数量",o.toInt).option("--testHtml <bool>","是否生成测试 HTML",o.toBoolean).option("-r,--reporter <bool>","是否生成 reporter.bin",o.toBoolean).option("--previewImage.text <string>","会显示在 svg 中的文本").option("--previewImage.name <string>","svg 文件的名称").option("--renameOutputFont <string>","重命名输出字体").option("-b,--buildMode <string>","TODO 构建模式").option("-l,--languageAreas <bool>","是否进行语言区域优化",o.toBoolean).option("--multiThreads <bool>","TODO 是否使用多线程",o.toBoolean).option("-f,--fontFeature <bool>","是否启用字体特性",o.toBoolean).option("--reduceMins <bool>","是否减少最小分包,",o.toBoolean).option("-a,--autoSubset <bool>","是否自动子集化",o.toBoolean).option("--subsetRemainChars <bool>","是否自动添加没有声明的字符",o.toBoolean);const l=(s,e)=>{const t=new i.Command;return t.addCommand(n,{isDefault:!0}),e&&e(t,n),t.parse(s)};exports.getCliParams=l;
//# sourceMappingURL=proto.js.map