Caching improvement: now caching works across families

This commit is contained in:
be5invis 2022-05-28 11:34:34 -07:00
parent de458c9fce
commit 04a6a29238
7 changed files with 122 additions and 34 deletions

View file

@ -27,10 +27,13 @@ exports.buildFont = async function buildFont(argv, para) {
}
}
const cache = await Caching.load(argv);
// Finalize (like geometry conversion)
const cache = await Caching.load(argv.iCache, argv.menu.version, argv.cacheFreshAgeKey);
const finalGs = finalizeFont(cache, para, gs.glyphStore, excludeChars, otl);
await Caching.save(argv, cache);
if (cache.isUpdated()) {
await Caching.save(argv.oCache, argv.menu.version, cache, true);
}
const font = convertOtd(baseFont, otl, finalGs);
return { font, glyphStore: finalGs };
return { font, glyphStore: finalGs, cacheUpdated: cache.isUpdated() };
};