Skip to content

Commit

Permalink
Merge branch 'dev' into prerelease
Browse files Browse the repository at this point in the history
  • Loading branch information
be5invis committed Mar 11, 2024
2 parents 69c6847 + 4547c52 commit 5aa5d95
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 31 deletions.
20 changes: 13 additions & 7 deletions tools/generate-release-notes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@ async function main() {

let o = "";

o += `## Coarse-grained download links (contains all languages)\n\n`;
o += `## SuperTTC and TTC Archives (Contain all families and languages)\n\n`;

o += ` * [SuperTTC](https://github.com/be5invis/Sarasa-Gothic/releases/download/v${version}/Sarasa-SuperTTC-${version}.7z) ([Unhinted](https://github.com/be5invis/Sarasa-Gothic/releases/download/v${version}/Sarasa-SuperTTC-Unhinted-${version}.7z))\n`;
o += ` * [TTC](https://github.com/be5invis/Sarasa-Gothic/releases/download/v${version}/Sarasa-TTC-${version}.7z) ([Unhinted](https://github.com/be5invis/Sarasa-Gothic/releases/download/v${version}/Sarasa-TTC-Unhinted-${version}.7z))\n`;
o += ` * [TTF](https://github.com/be5invis/Sarasa-Gothic/releases/download/v${version}/Sarasa-TTF-${version}.7z) ([Unhinted](https://github.com/be5invis/Sarasa-Gothic/releases/download/v${version}/Sarasa-TTF-Unhinted-${version}.7z))\n`;
o += ` * [SuperTTC](https://github.com/be5invis/Sarasa-Gothic/releases/download/v${version}/Sarasa-SuperTTC-${version}.zip) ([Unhinted](https://github.com/be5invis/Sarasa-Gothic/releases/download/v${version}/Sarasa-SuperTTC-Unhinted-${version}.zip))\n`;
o += ` * [TTC](https://github.com/be5invis/Sarasa-Gothic/releases/download/v${version}/Sarasa-TTC-${version}.zip) ([Unhinted](https://github.com/be5invis/Sarasa-Gothic/releases/download/v${version}/Sarasa-TTC-Unhinted-${version}.zip))\n`;

o += `## Fine-grained download links\n\n`;
o += `## TTF Archives\n\n`;
o += `### Single Family, Multiple Languages Package\n\n`;
for (const family of config.familyOrder) {
o += `* [${family}](https://github.com/be5invis/Sarasa-Gothic/releases/download/v${version}/Sarasa${family}-TTF-${version}.zip) `;
o += `([Unhinted](https://github.com/be5invis/Sarasa-Gothic/releases/download/v${version}/Sarasa${family}-TTF-Unhinted-${version}.zip))\n`;
}

o += `### Single Family & Language\n\n`;
o += generateTableHeader(config);
for (const subfamily of config.subfamilyOrder) {
o += generateTableRow(config, subfamily, process.argv[2]);
Expand All @@ -46,8 +52,8 @@ function generateTableRow(config, subfamily, version) {
let o = `| ${subfamily} `;
for (const family of config.familyOrder) {
o += "| ";
o += `[TTF](https://github.com/be5invis/Sarasa-Gothic/releases/download/v${version}/Sarasa${family}${subfamily}-TTF-${version}.7z) `;
o += `([Unhinted](https://github.com/be5invis/Sarasa-Gothic/releases/download/v${version}/Sarasa${family}${subfamily}-TTF-Unhinted-${version}.7z)) `;
o += `[TTF](https://github.com/be5invis/Sarasa-Gothic/releases/download/v${version}/Sarasa${family}${subfamily}-TTF-${version}.zip) `;
o += `([Unhinted](https://github.com/be5invis/Sarasa-Gothic/releases/download/v${version}/Sarasa${family}${subfamily}-TTF-Unhinted-${version}.zip)) `;
}
o += "|\n";
return o;
Expand Down
45 changes: 21 additions & 24 deletions verdafile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,24 @@ const Start = phony("all", async t => {
const [config, version] = await t.need(Config, Version);
await t.need(Ttf, Ttc);

let archiveTargets = [
TtcArchive(`TTC`, version),
TtcArchive(`TTC-Unhinted`, version),
SuperTtcArchive(`TTC`, version),
SuperTtcArchive(`TTC-Unhinted`, version)
];

// Standalone archives
for (const f of config.familyOrder) {
let standaloneTargets = [];
archiveTargets.push(SingleFamilyTtfArchive(`TTF`, f, version));
archiveTargets.push(SingleFamilyTtfArchive(`TTF-Unhinted`, f, version));
for (const sf of config.subfamilyOrder) {
standaloneTargets.push(StandaloneTtfArchive(`TTF`, f, sf, version));
standaloneTargets.push(StandaloneTtfArchive(`TTF-Unhinted`, f, sf, version));
archiveTargets.push(StandaloneTtfArchive(`TTF`, f, sf, version));
archiveTargets.push(StandaloneTtfArchive(`TTF-Unhinted`, f, sf, version));
}
await t.need(standaloneTargets);
}

// "Everything" archives
await t.need(
TtcArchive(`TTC`, version),
TtcArchive(`TTC-Unhinted`, version),
SuperTtcArchive(`TTC`, version),
SuperTtcArchive(`TTC-Unhinted`, version),
TtfArchive(`TTF`, version),
TtfArchive(`TTF-Unhinted`, version)
);
await t.need(archiveTargets);

await run(
"node",
Expand Down Expand Up @@ -98,37 +97,35 @@ const Version = oracle("oracles::version", async t => {
});

const SuperTtcArchive = file.make(
(infix, version) => `${OUT}/${PREFIX}-Super${infix}-${version}.7z`,
(infix, version) => `${OUT}/${PREFIX}-Super${infix}-${version}.zip`,
async (t, out, infix) => {
const [input] = await t.need(SuperTtcFile(infix));
await rm(out.full);
await SevenZipCompress(`${OUT}/.super-ttc`, out.full, input.base);
}
);
const TtcArchive = file.make(
(infix, version) => `${OUT}/${PREFIX}-${infix}-${version}.7z`,
(infix, version) => `${OUT}/${PREFIX}-${infix}-${version}.zip`,
async (t, out, infix) => {
await t.need(TtcFontFiles(infix));
await rm(out.full);
await SevenZipCompress(`${OUT}/${infix}`, out.full, `*.ttc`);
}
);

const TtfArchive = file.make(
(infix, version) => `${OUT}/${PREFIX}-${infix}-${version}.7z`,
async (t, out, infix) => {
const SingleFamilyTtfArchive = file.make(
(infix, family, version) => `${OUT}/${PREFIX}${family}-${infix}-${version}.zip`,
async (t, out, infix, family, version) => {
const [config] = await t.need(Config, TtfFontFiles(infix));
await rm(out.full);
for (let j = 0; j < config.styleOrder.length; j += 1) {
const style = config.styleOrder[j];
await SevenZipCompress(`${OUT}/${infix}`, out.full, `*-${style}.ttf`);
for (const sf of config.subfamilyOrder) {
await SevenZipCompress(`${OUT}/${infix}`, out.full, `${PREFIX}${family}${sf}-*.ttf`);
}
}
);

const StandaloneTtfArchive = file.make(
(infix, family, subfamily, version) =>
`${OUT}/${PREFIX}${family}${subfamily}-${infix}-${version}.7z`,
`${OUT}/${PREFIX}${family}${subfamily}-${infix}-${version}.zip`,
async (t, out, infix, family, subfamily, version) => {
await t.need(Config, TtfFontFiles(infix));
await rm(out.full);
Expand All @@ -139,7 +136,7 @@ const StandaloneTtfArchive = file.make(
function SevenZipCompress(dir, target, ...inputs) {
return cd(dir).run(
[SEVEN_ZIP, `a`],
[`-t7z`, `-mmt=on`, `-mx=9`],
[`-tzip`, `-mmt=on`, `-mx=9`],
[path.relative(dir, target), ...inputs]
);
}
Expand Down

0 comments on commit 5aa5d95

Please sign in to comment.