Move caching into font builder
This commit is contained in:
parent
6dfcc92cc9
commit
5025aa1d7b
3 changed files with 6 additions and 8 deletions
|
@ -4,12 +4,13 @@ const EmptyFont = require("./empty-font");
|
||||||
const buildGlyphs = require("../glyphs/index");
|
const buildGlyphs = require("../glyphs/index");
|
||||||
const finalizeFont = require("./finalize/index");
|
const finalizeFont = require("./finalize/index");
|
||||||
const convertOtd = require("./otd-conv/index");
|
const convertOtd = require("./otd-conv/index");
|
||||||
|
const Caching = require("./caching/index");
|
||||||
|
|
||||||
const { buildOtl } = require("../otl/index");
|
const { buildOtl } = require("../otl/index");
|
||||||
const { assignFontNames } = require("../meta/naming");
|
const { assignFontNames } = require("../meta/naming");
|
||||||
const { copyFontMetrics } = require("../meta/aesthetics");
|
const { copyFontMetrics } = require("../meta/aesthetics");
|
||||||
|
|
||||||
module.exports = async function (cache, para) {
|
module.exports = async function (argv, para) {
|
||||||
const otd = EmptyFont();
|
const otd = EmptyFont();
|
||||||
const gs = buildGlyphs(para);
|
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);
|
const finalGs = finalizeFont(cache, para, gs.glyphStore, excludeChars, otd);
|
||||||
|
await Caching.save(argv, cache);
|
||||||
|
|
||||||
const font = convertOtd(otd, finalGs);
|
const font = convertOtd(otd, finalGs);
|
||||||
return { font, glyphStore: finalGs };
|
return { font, glyphStore: finalGs };
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,7 +8,6 @@ const { encode } = require("@msgpack/msgpack");
|
||||||
const { FontIo } = require("ot-builder");
|
const { FontIo } = require("ot-builder");
|
||||||
const Toml = require("@iarna/toml");
|
const Toml = require("@iarna/toml");
|
||||||
|
|
||||||
const Caching = require("./caching/index");
|
|
||||||
const BuildFont = require("./gen/build-font.js");
|
const BuildFont = require("./gen/build-font.js");
|
||||||
const Parameters = require("./support/parameters");
|
const Parameters = require("./support/parameters");
|
||||||
const VariantData = require("./support/variant-data");
|
const VariantData = require("./support/variant-data");
|
||||||
|
@ -17,14 +16,9 @@ const { createGrDisplaySheet } = require("./support/gr");
|
||||||
|
|
||||||
module.exports = async function main(argv) {
|
module.exports = async function main(argv) {
|
||||||
const paraT = await getParameters();
|
const paraT = await getParameters();
|
||||||
|
const { font, glyphStore } = await BuildFont(argv, paraT(argv));
|
||||||
const cache = await Caching.load(argv);
|
|
||||||
|
|
||||||
const { font, glyphStore } = await BuildFont(cache, paraT(argv));
|
|
||||||
if (argv.oCharMap) await saveCharMap(argv, glyphStore);
|
if (argv.oCharMap) await saveCharMap(argv, glyphStore);
|
||||||
if (argv.o) await saveTTF(argv, font);
|
if (argv.o) await saveTTF(argv, font);
|
||||||
|
|
||||||
await Caching.save(argv, cache);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Parameter preparation
|
// Parameter preparation
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue