Skip to content

Commit

Permalink
Merge branch 'master' into releases
Browse files Browse the repository at this point in the history
  • Loading branch information
be5invis committed Nov 2, 2019
2 parents e6c25ae + 9d0b145 commit 2eba95e
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 31 deletions.
17 changes: 17 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 90
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 30
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ npm run build ttc

instead, the files would be in `out/ttc` directory.

Please note tnat you will need *a lot of* memory to create TTCs, due to the huge quantity of subfamily-orthography combinations.
Please note that you will need *a lot of* memory to create TTCs, due to the huge quantity of subfamily-orthography combinations.

## What are the names?

Expand Down
1 change: 1 addition & 0 deletions checkenv.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function check(util) {
check("ttx");
check("otc2otf");
check("otf2otc");
check("otf2ttf");
check("otfccdump");
check("otfccbuild");
check("ttfautohint");
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"TC": { "gbk": false, "big5": true, "jis": false, "korean": false },
"HC": { "gbk": false, "big5": true, "jis": false, "korean": false },
"CL": { "gbk": false, "big5": true, "jis": false, "korean": false },
"k": { "gbk": false, "big5": false, "jis": false, "korean": true }
"K": { "gbk": false, "big5": false, "jis": false, "korean": true }
},
"nameTupleSelector": {
"J": ["en_US", "ja_JP"],
Expand Down
3 changes: 1 addition & 2 deletions make/hangul/build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

const { quadify, introduce, build, gc } = require("megaminx");
const { introduce, build, gc } = require("megaminx");
const { isKorean, filterUnicodeRange } = require("../common/unicode-kind");

async function pass(ctx, config, argv) {
Expand All @@ -10,7 +10,6 @@ async function pass(ctx, config, argv) {
ignoreHints: true
});
filterUnicodeRange(a, isKorean);
await ctx.run(quadify, "a");
a.cvt_ = [];
a.fpgm = [];
a.prep = [];
Expand Down
3 changes: 1 addition & 2 deletions make/kanji/build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

const { quadify, introduce, build, gc } = require("megaminx");
const { introduce, build, gc } = require("megaminx");
const { isIdeograph, filterUnicodeRange } = require("../common/unicode-kind");

async function pass(ctx, config, argv) {
Expand All @@ -10,7 +10,6 @@ async function pass(ctx, config, argv) {
ignoreHints: true
});
filterUnicodeRange(a, isIdeograph);
await ctx.run(quadify, "a");
a.cvt_ = [];
a.fpgm = [];
a.prep = [];
Expand Down
3 changes: 1 addition & 2 deletions make/punct/as.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

const { quadify, introduce, build, gc, manip } = require("megaminx");
const { introduce, build, gc, manip } = require("megaminx");
const {
isIdeograph,
isWestern,
Expand All @@ -16,7 +16,6 @@ module.exports = async function makeFont(ctx, config, argv) {
prefix: "a",
ignoreHints: true
});
await ctx.run(quadify, "a");
a.cmap_uvs = null;
filterUnicodeRange(
a,
Expand Down
3 changes: 1 addition & 2 deletions make/punct/ws.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

const { quadify, introduce, build, gc, manip } = require("megaminx");
const { introduce, build, gc, manip } = require("megaminx");
const {
isIdeograph,
isWestern,
Expand All @@ -16,7 +16,6 @@ module.exports = async function makeFont(ctx, config, argv) {
prefix: "a",
ignoreHints: true
});
await ctx.run(quadify, "a");
a.cmap_uvs = null;
filterUnicodeRange(
a,
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "sarasa-gothic",
"version": "0.10.0",
"version": "0.9.2",
"main": "./run",
"dependencies": {
"@chlorophytum/cli": "^0.3.0",
"@chlorophytum/final-hint-format-hltt": "^0.3.0",
"@chlorophytum/font-format-otd": "^0.3.0",
"@chlorophytum/hint-store-provider-file": "^0.3.0",
"@chlorophytum/ideograph-shape-analyzer-1": "^0.3.4",
"@chlorophytum/ideograph-shape-analyzer-1": "^0.3.6",
"colors": "^1.1.2",
"fs-extra": "^3.0.1",
"megaminx": "^0.6.3",
"otfcc-ttcize": "^0.9.0",
"otfcc-ttcize": "^0.9.2",
"verda": "^1.0.0-10",
"which": "^1.2.14",
"yargs": "^9.0.0"
Expand Down
46 changes: 28 additions & 18 deletions verdafile.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const NODEJS = `node`;
const SEVEN_ZIP = `7z`;
const OTFCCDUMP = `otfccdump`;
const OTFCCBUILD = `otfccbuild`;
const OTF2TTF = `otf2ttf`;

///////////////////////////////////////////////////////////////////////////////////////////////////
// Entrypoint
Expand Down Expand Up @@ -54,50 +55,54 @@ const TTCArchive = file.make(
version => `${OUT}/sarasa-gothic-ttc-${version}.7z`,
async (t, target) => {
await t.need(TtcFontFiles);
await cd(`${OUT}/ttc`).run(
[SEVEN_ZIP, `a`],
[`-t7z`, `-mmt=on`, `-m0=LZMA:a=0:d=1536m:fb=256`],
[`../${target.name}.7z`, `*.ttc`]
);
await rm(target.full);
await SevenZipCompress(`${OUT}/ttc`, target, `*.ttc`);
}
);
const TTFArchive = file.make(
version => `${OUT}/sarasa-gothic-ttf-${version}.7z`,
async (t, target) => {
const [config] = await t.need(Config, de`${OUT}/ttf`);
await t.need(TtfFontFiles);
await rm(target.full);

// StyleOrder is interlaced with "upright" and "italic"
// Compressing in this order reduces archive size
await rm(target.full);
for (let j = 0; j < config.styleOrder.length; j += 2) {
const styleUpright = config.styleOrder[j];
const styleItalic = config.styleOrder[j + 1];
await cd(`${OUT}/ttf`).run(
[`7z`, `a`],
[`-t7z`, `-mmt=on`, `-m0=LZMA:a=0:d=1536m:fb=256`],
[
`../${target.name}.7z`,
styleUpright ? `*-${styleUpright}.ttf` : null,
styleItalic ? `*-${styleItalic}.ttf` : null
]
await SevenZipCompress(
`${OUT}/ttf`,
target,
styleUpright ? `*-${styleUpright}.ttf` : null,
styleItalic ? `*-${styleItalic}.ttf` : null
);
}
}
);

function SevenZipCompress(dir, target, ...inputs) {
return cd(dir).run(
[SEVEN_ZIP, `a`],
[`-t7z`, `-mmt=on`, `-m0=LZMA:a=0:d=256m:fb=256`],
[`../${target.name}.7z`, ...inputs]
);
}

///////////////////////////////////////////////////////////////////////////////////////////////////
// TTF Building
const ShsOtd = file.make(
(region, style) => `${BUILD}/shs/${region}-${style}.otd`,
async (t, { full, dir }, region, style) => {
async (t, output, region, style) => {
const [config] = await t.need(Config);
const shsSourceMap = config.shsSourceMap;
const [, $1] = await t.need(
de(dir),
de(output.dir),
fu`sources/shs/${shsSourceMap.region[region]}-${shsSourceMap.style[style]}.otf`
);
await run(OTFCCDUMP, `-o`, full, $1.full);
const temp = `${output.dir}/${output.name}.tmp.ttf`;
await run(OTF2TTF, [`-o`, temp], $1.full);
await run(OTFCCDUMP, `-o`, output.full, temp);
}
);

Expand Down Expand Up @@ -381,7 +386,12 @@ const TTCFile = file.make(

const [$$] = await t.need(requirements.map(t => t.from));
const ttcize = "node_modules/.bin/otfcc-ttcize" + (os.platform() === "win32" ? ".cmd" : "");
await run(ttcize, ["-o", full], [...$$.map(t => t.full)], ["-x"]);
await run(
ttcize,
["-x", "--common-width", 1000, "--common-height", 1000],
["-o", full],
[...$$.map(t => t.full)]
);
}
);

Expand Down

0 comments on commit 2eba95e

Please sign in to comment.