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

Commit 9ac69b2

Browse files
committed
r2.001.1
1 parent 0ea42c9 commit 9ac69b2

File tree

2 files changed

+44
-5
lines changed

2 files changed

+44
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "source-han-sans-ttf",
3-
"version": "2.001.0",
3+
"version": "2.001.1",
44
"private": true,
55
"dependencies": {
66
"@chlorophytum/cli": "^0.3.0",

verdafile.js

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const OTF2TTF = `otf2ttf`;
1919
const OTFCCDUMP = `otfccdump`;
2020
const OTFCCBUILD = `otfccbuild`;
2121
const TTFAUTOHINT = `ttfautohint`;
22+
const SEVEN_ZIP = `7z`;
2223

2324
build.setJournal(`build/.verda-build-journal`);
2425
build.setSelfTracking();
@@ -192,17 +193,18 @@ const Pass4Otd = file.make(
192193
///////////////////////////////////////////////////////////////////////////////////////////////////
193194
// Pass 5
194195

195-
const PASS5 = `${OUT}`;
196+
const OutTtf = `${OUT}/ttf`;
197+
const OutTtc = `${OUT}/ttc`;
196198
const Pass5Ttf = file.make(
197-
(init, weight) => `${PASS5}/${init}-${weight}.ttf`,
199+
(init, weight) => `${OutTtf}/${init}-${weight}.ttf`,
198200
async ($, output, init, weight) => {
199-
await $.need(de(PASS5));
201+
await $.need(de(OutTtf));
200202
const [input] = await $.need(Pass4Otd(init, weight));
201203
await OtfccBuildAsIs(input.full, output.full);
202204
}
203205
);
204206
const Pass5Group = file.make(
205-
(init, weight) => `${PASS5}/${init}-${weight}.ttc`,
207+
(init, weight) => `${OutTtc}/${init}-${weight}.ttc`,
206208
async ($, output, init, weight) => {
207209
const [config] = await $.need(Config);
208210
const [ttfs] = await $.need(GroupFileNamesT(config, weight, Pass5Ttf));
@@ -220,6 +222,39 @@ const All = task(`all`, async $ => {
220222
await $.need(config.weights.map(w => Pass5Group(config.prefix, w)));
221223
});
222224

225+
const TTCArchive = file.make(
226+
version => `${OUT}/source-han-sans-ttc-${version}.7z`,
227+
async (t, target) => {
228+
await t.need(All);
229+
await rm(target.full);
230+
await cd(`${OUT}/ttc`).run(
231+
[SEVEN_ZIP, `a`],
232+
[`-t7z`, `-mmt=on`, `-m0=LZMA:a=0:d=1536m:fb=256`],
233+
[`../${target.name}.7z`, `*.ttc`]
234+
);
235+
}
236+
);
237+
const TTFArchive = file.make(
238+
version => `${OUT}/source-han-sans-ttf-${version}.7z`,
239+
async (t, target) => {
240+
const [config] = await t.need(Config, de`${OUT}/ttf`);
241+
await t.need(All);
242+
await rm(target.full);
243+
for (const weight of config.weights) {
244+
await cd(`${OUT}/ttf`).run(
245+
[SEVEN_ZIP, `a`],
246+
[`-t7z`, `-mmt=on`, `-m0=LZMA:a=0:d=1536m:fb=256`],
247+
[`../${target.name}.7z`, `*-${weight}.ttf`]
248+
);
249+
}
250+
}
251+
);
252+
253+
const Release = task(`release`, async $ => {
254+
const version = await $.need(Version);
255+
await $.need(TTFArchive(version), TTCArchive(version));
256+
});
257+
223258
async function OtfccBuildAsIs(from, to) {
224259
await run(OTFCCBUILD, from, [`-o`, to], [`-k`, `-s`, `--keep-average-char-width`, `-q`]);
225260
}
@@ -229,4 +264,8 @@ async function OtfccBuildAsIs(from, to) {
229264
const Config = oracle("config", async () => {
230265
return await fs.readJSON(__dirname + "/config.json");
231266
});
267+
const Version = oracle("oracles::version", async () => {
268+
const pkg = await fs.readJSON(__dirname + "/package.json");
269+
return pkg.version;
270+
});
232271
const JHint = oracle("hinting-jobs", async () => os.cpus().length);

0 commit comments

Comments
 (0)