Move caching into font builder

This commit is contained in:
be5invis 2021-04-26 23:53:47 -07:00
parent 6dfcc92cc9
commit 5025aa1d7b
3 changed files with 6 additions and 8 deletions

View file

@ -4,12 +4,13 @@ const EmptyFont = require("./empty-font");
const buildGlyphs = require("../glyphs/index");
const finalizeFont = require("./finalize/index");
const convertOtd = require("./otd-conv/index");
const Caching = require("./caching/index");
const { buildOtl } = require("../otl/index");
const { assignFontNames } = require("../meta/naming");
const { copyFontMetrics } = require("../meta/aesthetics");
module.exports = async function (cache, para) {
module.exports = async function (argv, para) {
const otd = EmptyFont();
const gs = buildGlyphs(para);
@ -29,7 +30,10 @@ module.exports = async function (cache, para) {
}
}
const cache = await Caching.load(argv);
const finalGs = finalizeFont(cache, para, gs.glyphStore, excludeChars, otd);
await Caching.save(argv, cache);
const font = convertOtd(otd, finalGs);
return { font, glyphStore: finalGs };
};

View file

@ -8,7 +8,6 @@ const { encode } = require("@msgpack/msgpack");
const { FontIo } = require("ot-builder");
const Toml = require("@iarna/toml");
const Caching = require("./caching/index");
const BuildFont = require("./gen/build-font.js");
const Parameters = require("./support/parameters");
const VariantData = require("./support/variant-data");
@ -17,14 +16,9 @@ const { createGrDisplaySheet } = require("./support/gr");
module.exports = async function main(argv) {
const paraT = await getParameters();
const cache = await Caching.load(argv);
const { font, glyphStore } = await BuildFont(cache, paraT(argv));
const { font, glyphStore } = await BuildFont(argv, paraT(argv));
if (argv.oCharMap) await saveCharMap(argv, glyphStore);
if (argv.o) await saveTTF(argv, font);
await Caching.save(argv, cache);
};
// Parameter preparation