Refine build process for super TTC
This commit is contained in:
parent
8e59ec30c9
commit
846b1d1808
3 changed files with 12 additions and 26 deletions
|
@ -46,7 +46,7 @@ Iosevka supports Language-Specific Ligations, which is the ligation set enabled
|
||||||
|
|
||||||
To build Iosevka you should:
|
To build Iosevka you should:
|
||||||
|
|
||||||
1. Ensure that [`nodejs`](http://nodejs.org) (≥ 8.4), [`ttfautohint`](http://www.freetype.org/ttfautohint/), [`otfcc`](https://github.com/caryll/otfcc) (≥ 0.9.3).
|
1. Ensure that [`nodejs`](http://nodejs.org) (≥ 8.4), [`ttfautohint`](http://www.freetype.org/ttfautohint/), [`otfcc`](https://github.com/caryll/otfcc) (≥ 0.9.3) and `otf2otc` are present.
|
||||||
2. Install necessary libs by `npm install`. If you’ve installed them, upgrade to the latest.
|
2. Install necessary libs by `npm install`. If you’ve installed them, upgrade to the latest.
|
||||||
3. `npm run build -- contents::iosevka`.
|
3. `npm run build -- contents::iosevka`.
|
||||||
|
|
||||||
|
|
|
@ -15,3 +15,4 @@ function check(util) {
|
||||||
check("otfccdump");
|
check("otfccdump");
|
||||||
check("otfccbuild");
|
check("otfccbuild");
|
||||||
check("ttfautohint");
|
check("ttfautohint");
|
||||||
|
check("otf2otc");
|
||||||
|
|
35
verdafile.js
35
verdafile.js
|
@ -17,6 +17,7 @@ const BUILD = "build";
|
||||||
const DIST = "dist";
|
const DIST = "dist";
|
||||||
const ARCHIVE_DIR = "release-archives";
|
const ARCHIVE_DIR = "release-archives";
|
||||||
|
|
||||||
|
const OTF2OTC = "otf2otc";
|
||||||
const PATEL_C = ["node", "./node_modules/patel/bin/patel-c"];
|
const PATEL_C = ["node", "./node_modules/patel/bin/patel-c"];
|
||||||
const TTCIZE = ["node", "./node_modules/otfcc-ttcize/bin/_startup"];
|
const TTCIZE = ["node", "./node_modules/otfcc-ttcize/bin/_startup"];
|
||||||
const GENERATE = ["node", "gen/generator"];
|
const GENERATE = ["node", "gen/generator"];
|
||||||
|
@ -243,9 +244,6 @@ function fnStandardTtc(collectConfig, prefix, w, wd, s) {
|
||||||
);
|
);
|
||||||
return `${prefix}-${ttcSuffix}`;
|
return `${prefix}-${ttcSuffix}`;
|
||||||
}
|
}
|
||||||
function fnSuperTtc(collectConfig, prefix, w, wd, s) {
|
|
||||||
return prefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
const CollectPlans = computed(`metadata:collect-plans`, async target => {
|
const CollectPlans = computed(`metadata:collect-plans`, async target => {
|
||||||
const [rawCollectPlans, suffixMapping, collectConfig] = await target.need(
|
const [rawCollectPlans, suffixMapping, collectConfig] = await target.need(
|
||||||
|
@ -261,14 +259,6 @@ const CollectPlans = computed(`metadata:collect-plans`, async target => {
|
||||||
fnStandardTtc
|
fnStandardTtc
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
const SuperTtcCollectPlans = computed(`metadata:super-ttc-collect-plans`, async target => {
|
|
||||||
const [rawCollectPlans, suffixMapping, collectConfig] = await target.need(
|
|
||||||
RawCollectPlans,
|
|
||||||
Suffixes,
|
|
||||||
CollectConfig
|
|
||||||
);
|
|
||||||
return await getCollectPlans(target, rawCollectPlans, suffixMapping, collectConfig, fnSuperTtc);
|
|
||||||
});
|
|
||||||
|
|
||||||
const HivesOf = computed.group("metadata:hives-of", async (target, gid) => {
|
const HivesOf = computed.group("metadata:hives-of", async (target, gid) => {
|
||||||
const [{ fontInfos }] = await target.need(FontBuildingParameters);
|
const [{ fontInfos }] = await target.need(FontBuildingParameters);
|
||||||
|
@ -291,13 +281,6 @@ const CollectionPartsOf = computed.group("metadata:collection-parts-of", async (
|
||||||
const [{ composition }] = await target.need(CollectPlans);
|
const [{ composition }] = await target.need(CollectPlans);
|
||||||
return composition[id];
|
return composition[id];
|
||||||
});
|
});
|
||||||
const SuperTtcCollectionPartsOf = computed.group(
|
|
||||||
"metadata:super-ttc-collection-parts-of",
|
|
||||||
async (target, id) => {
|
|
||||||
const [{ composition }] = await target.need(SuperTtcCollectPlans);
|
|
||||||
return composition[id];
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
////// Font Building //////
|
////// Font Building //////
|
||||||
|
@ -387,8 +370,13 @@ const DistTTC = file.make(
|
||||||
const SuperTTC = file.make(
|
const SuperTTC = file.make(
|
||||||
f => `${DIST}/super-ttc/${f}.ttc`,
|
f => `${DIST}/super-ttc/${f}.ttc`,
|
||||||
async (target, out, f) => {
|
async (target, out, f) => {
|
||||||
const [parts] = await target.need(SuperTtcCollectionPartsOf(f));
|
await target.need(de(out.dir));
|
||||||
await buildTtcForFile(target, parts, out, true);
|
const [inputs] = await target.need(CollectionFontsOf(f));
|
||||||
|
await run(
|
||||||
|
OTF2OTC,
|
||||||
|
["-o", out.full],
|
||||||
|
inputs.map(f => f.full)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
async function buildTtcForFile(target, parts, out, xMode) {
|
async function buildTtcForFile(target, parts, out, xMode) {
|
||||||
|
@ -482,7 +470,8 @@ const GroupArchives = task.group(`archive`, async (target, gid) => {
|
||||||
// Collection-level
|
// Collection-level
|
||||||
const CollectionFontsOf = task.group("collection-fonts", async (target, cid) => {
|
const CollectionFontsOf = task.group("collection-fonts", async (target, cid) => {
|
||||||
const [{ groups }] = await target.need(CollectPlans);
|
const [{ groups }] = await target.need(CollectPlans);
|
||||||
await target.need(groups[cid].map(file => DistTTC(cid, file)));
|
const [files] = await target.need(groups[cid].map(file => DistTTC(cid, file)));
|
||||||
|
return files;
|
||||||
});
|
});
|
||||||
const TTCArchiveFile = file.make(
|
const TTCArchiveFile = file.make(
|
||||||
(cid, version) => `${ARCHIVE_DIR}/ttc-${cid}-${version}.zip`,
|
(cid, version) => `${ARCHIVE_DIR}/ttc-${cid}-${version}.zip`,
|
||||||
|
@ -628,7 +617,3 @@ const Scripts = task("scripts", async target => {
|
||||||
const [js] = await target.need(ScriptFiles("js"));
|
const [js] = await target.need(ScriptFiles("js"));
|
||||||
await target.need(js.map(ScriptJS));
|
await target.need(js.map(ScriptJS));
|
||||||
});
|
});
|
||||||
|
|
||||||
task("get-collect-plans", async target => {
|
|
||||||
await target.need(SuperTtcCollectPlans);
|
|
||||||
});
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue