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