Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

Commit

Permalink
Add TTC build
Browse files Browse the repository at this point in the history
  • Loading branch information
be5invis committed Oct 16, 2019
1 parent 9afac0d commit 0ea42c9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"otds",
"otfccbuild",
"otfccdump",
"ttcize",
"ttfautohint",
"verda"
],
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ A script for building TTF version of Source Han Sans (again).

```bash
npm install
npm run build
npm run build all
```
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"fs-extra": "^3.0.1",
"colors": "^1.1.2",
"verda": "^1.0.0-10",
"which": "^1.2.14"
"which": "^1.2.14",
"otfcc-ttcize": "^0.9.2"
},
"scripts": {
"install": "node checkenv",
"verda": "verda -f verdafile.js",
"build": "verda -f verdafile.js ttf"
"build": "verda -f verdafile.js"
}
}
19 changes: 13 additions & 6 deletions verdafile.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,23 @@ const Pass5Ttf = file.make(
await OtfccBuildAsIs(input.full, output.full);
}
);
const Pass5Group = task.make(
weight => `pass5-group::${weight}`,
async ($, weight) => {
const Pass5Group = file.make(
(init, weight) => `${PASS5}/${init}-${weight}.ttc`,
async ($, output, init, weight) => {
const [config] = await $.need(Config);
await $.need(GroupFileNamesT(config, weight, Pass5Ttf));
const [ttfs] = await $.need(GroupFileNamesT(config, weight, Pass5Ttf));
const ttcize = "node_modules/.bin/otfcc-ttcize" + (os.platform() === "win32" ? ".cmd" : "");
await run(
ttcize,
["-x", "--common-width", 1000, "--common-height", 1000],
["-o", output.full],
[...ttfs.map(t => t.full)]
);
}
);
const Ttf = task(`ttf`, async $ => {
const All = task(`all`, async $ => {
const [config] = await $.need(Config);
await $.need(config.weights.map(w => Pass5Group(w)));
await $.need(config.weights.map(w => Pass5Group(config.prefix, w)));
});

async function OtfccBuildAsIs(from, to) {
Expand Down

0 comments on commit 0ea42c9

Please sign in to comment.