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.

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