Upgrade dep

This commit is contained in:
Belleve Invis 2020-05-04 21:43:56 -07:00
parent 780d295a57
commit 8d7a304b96
3 changed files with 29 additions and 24 deletions

View file

@ -14,7 +14,6 @@
"extends": ["eslint:recommended", "prettier"], "extends": ["eslint:recommended", "prettier"],
"rules": { "rules": {
"indent": ["error", "tab", { "SwitchCase": 1 }], "indent": ["error", "tab", { "SwitchCase": 1 }],
"quotes": ["error", "double", { "allowTemplateLiterals": true }],
"semi": ["error", "always"], "semi": ["error", "always"],
"no-var": "error", "no-var": "error",
"no-console": 0, "no-console": 0,

View file

@ -12,7 +12,7 @@
"dependencies": { "dependencies": {
"caryll-shapeops": "^0.3.1", "caryll-shapeops": "^0.3.1",
"object-assign": "^4.1.1", "object-assign": "^4.1.1",
"otfcc-ttcize": "^0.9.6", "otfcc-ttcize": "^0.10.0",
"typo-geom": "^0.5.1", "typo-geom": "^0.5.1",
"spiro": "^1.1.0", "spiro": "^1.1.0",
"toml": "^3.0.0", "toml": "^3.0.0",
@ -32,6 +32,7 @@
"patel": "^0.33.1", "patel": "^0.33.1",
"semver": "^7.1.3", "semver": "^7.1.3",
"stylus": "^0.54.7", "stylus": "^0.54.7",
"unicode-13.0.0": "^0.8.0" "unicode-13.0.0": "^0.8.0",
"prettier": "^2.0.5"
} }
} }

View file

@ -349,18 +349,17 @@ const CollectionPartsOf = computed.group("metadata:collection-parts-of", async (
////// Font Building ////// ////// Font Building //////
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
const BuildTTF = file.make( const BuildOTD = file.make(
(gr, fn) => `${BUILD}/${gr}/${fn}.ttf`, (gr, fn) => `${BUILD}/${gr}/${fn}.otd`,
async (target, output, _gr, fn) => { async (target, output, _gr, fn) => {
const [ const [
{ hives, family, shapeWeight, menuWeight, menuSlant, menuWidth }, { hives, family, shapeWeight, menuWeight, menuSlant, menuWidth },
version version
] = await target.need(HivesOf(fn), Version); ] = await target.need(HivesOf(fn), Version);
const otdTmp = output.dir + "/" + output.name + ".tmp.otd";
const charmap = output.dir + "/" + output.name + ".charmap"; const charmap = output.dir + "/" + output.name + ".charmap";
await target.need(Scripts, fu`parameters.toml`, de`${output.dir}`); await target.need(Scripts, fu`parameters.toml`, de`${output.dir}`);
await node("gen/index", { await node("gen/index", {
o: otdTmp, o: output.full,
charmap, charmap,
family, family,
version, version,
@ -370,19 +369,26 @@ const BuildTTF = file.make(
menuWidth, menuWidth,
hives hives
}); });
await run(
"otfccbuild",
otdTmp,
["-o", output.full],
["-O3", "--keep-average-char-width", "-q"]
);
await rm(otdTmp);
} }
); );
const BuildTTF = file.make(
(gr, fn) => `${BUILD}/${gr}/${fn}.ttf`,
async (target, output, gr, fn) => {
const [otd] = await target.need(BuildOTD(gr, fn), de`${output.dir}`);
await run(
"otfccbuild",
otd.full,
["-o", `${output.full}`],
["-O3", "--keep-average-char-width", "-q"]
);
}
);
const BuildCM = file.make( const BuildCM = file.make(
(gr, f) => `${BUILD}/${gr}/${f}.charmap`, (gr, f) => `${BUILD}/${gr}/${f}.charmap`,
async (target, output, gr, f) => { async (target, output, gr, f) => {
await target.need(BuildTTF(gr, f)); await target.need(BuildOTD(gr, f));
} }
); );
@ -480,18 +486,17 @@ const ExportTtc = file.make(
(gr, f) => `${DIST}/export/${gr}/ttc/${f}.ttc`, (gr, f) => `${DIST}/export/${gr}/ttc/${f}.ttc`,
async (target, out, gr, f) => { async (target, out, gr, f) => {
const [parts] = await target.need(CollectionPartsOf(f)); const [parts] = await target.need(CollectionPartsOf(f));
await buildTtcForFile(target, parts, out, false); await buildTtcForFile(target, parts, out);
} }
); );
async function buildTtcForFile(target, parts, out, xMode) { async function buildTtcForFile(target, parts, out) {
await target.need(de`${out.dir}`); await target.need(de`${out.dir}`);
const [ttfs] = await target.need(parts.map(part => DistHintedTTF(part.dir, part.file))); const [ttfs] = await target.need(parts.map(part => BuildTTF(part.dir, part.file)));
await run( const tmpTtc = `${out.dir}/${out.name}.unhinted.ttc`;
TTCIZE, const ttfInputPaths = ttfs.map(p => p.full);
ttfs.map(p => p.full), await run(TTCIZE, ttfInputPaths, ["-o", tmpTtc]);
["-o", out.full], await run("ttfautohint", tmpTtc, out.full);
[xMode ? "-x" : "-h", "--common-width=500"] await rm(tmpTtc);
);
} }
// Collection Export // Collection Export