diff --git a/config.json b/config.json index d591b6c1e..2bbc3500e 100644 --- a/config.json +++ b/config.json @@ -16,6 +16,7 @@ }, "Ui": { "isPWID": true, + "isTNUM": true, "latinGroup": "Inter", "naming": { "en_US": "Sarasa UI", @@ -255,7 +256,7 @@ "styleMap": { "SemiBold": "Medium" }, - "classicalRegion": "cl", + "classicalRegion": "CL", "classicalOverridePrefix": "AdvocateAncientSansTC", "classicalOverrideSuffixMap": { "ExtraLight": "ExtraLight-subset", diff --git a/make/pass1/index.mjs b/make/pass1/index.mjs index 36095f56d..d571afac5 100644 --- a/make/pass1/index.mjs +++ b/make/pass1/index.mjs @@ -14,7 +14,6 @@ import { setFontMetadata } from "./metadata.mjs"; const __dirname = url.fileURLToPath(new URL(".", import.meta.url)); const globalConfig = JSON.parse(fs.readFileSync(path.resolve(__dirname, "../../config.json"))); -const packageConfig = JSON.parse(fs.readFileSync(path.resolve(__dirname, "../../package.json"))); const ENCODINGS = globalConfig.os2encodings; export default pass; @@ -44,6 +43,9 @@ async function pass(argv) { // Drop enclosed alphanumerics and PUA if (!argv.mono) dropCharacters(main, c => isEnclosedAlphanumerics(c) || isPua(c)); + // Bake tnum for UI + if (argv.tnum) bakeFeature("tnum", main, c => true); + if (argv.italize) { italize(as, +9.4); italize(ws, +9.4); @@ -63,7 +65,7 @@ async function pass(argv) { { en_US: { copyright: globalConfig.copyright, - version: `Version ${packageConfig.version}`, + version: `Version ${argv.version}`, family: globalConfig.families[argv.family].naming.en_US + " " + argv.subfamily, style: globalConfig.styles[argv.style].name }, diff --git a/package-lock.json b/package-lock.json index 4b86b53a0..b6bb0b268 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sarasa-gothic", - "version": "1.0.1", + "version": "1.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "sarasa-gothic", - "version": "1.0.1", + "version": "1.0.2", "hasInstallScript": true, "dependencies": { "@chlorophytum/cli": "^0.41.21", @@ -18,7 +18,7 @@ "fs-extra": "^11.2.0", "ot-builder": "^1.7.3", "otb-ttc-bundle": "^1.7.3", - "verda": "^1.11.1", + "verda": "^1.11.2", "which": "^4.0.0" }, "devDependencies": { @@ -3552,9 +3552,9 @@ } }, "node_modules/verda": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/verda/-/verda-1.11.1.tgz", - "integrity": "sha512-CJiuHqTFSm7qe4TccjZMI6iT+TJ2JpN7A2NEgYHk/EA8EKh6bVf5ITM7XnLF8v2qL5Hy/Bt2C6zpuNyDoVPDYQ==", + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/verda/-/verda-1.11.2.tgz", + "integrity": "sha512-sYO+7JmsXKQJQsmy8z1DKIxJS/FDClkdTQpdHXbp7ag5xugT2hjOOUXRoR0XoipseRqmNuwtgI71jP1HefZqAg==", "dependencies": { "chalk": "^4.1.2", "cli-cursor": "^3.1.0", diff --git a/package.json b/package.json index e1bb0d684..43879a9d5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sarasa-gothic", - "version": "1.0.1", + "version": "1.0.2", "main": "./run", "scripts": { "build": "verda -f verdafile.mjs", @@ -18,7 +18,7 @@ "fs-extra": "^11.2.0", "ot-builder": "^1.7.3", "otb-ttc-bundle": "^1.7.3", - "verda": "^1.11.1", + "verda": "^1.11.2", "which": "^4.0.0" }, "devDependencies": { diff --git a/sources/shs-classical-override/AdvocateAncientSansTC-Bold-subset.otf b/sources/shs-classical-override/AdvocateAncientSansTC-Bold-subset.otf index 783739612..401776059 100644 Binary files a/sources/shs-classical-override/AdvocateAncientSansTC-Bold-subset.otf and b/sources/shs-classical-override/AdvocateAncientSansTC-Bold-subset.otf differ diff --git a/sources/shs-classical-override/AdvocateAncientSansTC-ExtraLight-subset.otf b/sources/shs-classical-override/AdvocateAncientSansTC-ExtraLight-subset.otf index 985ae3dcd..64e6f3331 100644 Binary files a/sources/shs-classical-override/AdvocateAncientSansTC-ExtraLight-subset.otf and b/sources/shs-classical-override/AdvocateAncientSansTC-ExtraLight-subset.otf differ diff --git a/sources/shs-classical-override/AdvocateAncientSansTC-Heavy-subset.otf b/sources/shs-classical-override/AdvocateAncientSansTC-Heavy-subset.otf index 280281b35..8b6287e73 100644 Binary files a/sources/shs-classical-override/AdvocateAncientSansTC-Heavy-subset.otf and b/sources/shs-classical-override/AdvocateAncientSansTC-Heavy-subset.otf differ diff --git a/sources/shs-classical-override/AdvocateAncientSansTC-Light-subset.otf b/sources/shs-classical-override/AdvocateAncientSansTC-Light-subset.otf index 0eaa1705d..023c59992 100644 Binary files a/sources/shs-classical-override/AdvocateAncientSansTC-Light-subset.otf and b/sources/shs-classical-override/AdvocateAncientSansTC-Light-subset.otf differ diff --git a/sources/shs-classical-override/AdvocateAncientSansTC-Medium-subset.otf b/sources/shs-classical-override/AdvocateAncientSansTC-Medium-subset.otf index df8c23570..c0f6804e4 100644 Binary files a/sources/shs-classical-override/AdvocateAncientSansTC-Medium-subset.otf and b/sources/shs-classical-override/AdvocateAncientSansTC-Medium-subset.otf differ diff --git a/sources/shs-classical-override/AdvocateAncientSansTC-Normal-subset.otf b/sources/shs-classical-override/AdvocateAncientSansTC-Normal-subset.otf index 329f58b13..edd2e70ba 100644 Binary files a/sources/shs-classical-override/AdvocateAncientSansTC-Normal-subset.otf and b/sources/shs-classical-override/AdvocateAncientSansTC-Normal-subset.otf differ diff --git a/sources/shs-classical-override/AdvocateAncientSansTC-Regular-subset.otf b/sources/shs-classical-override/AdvocateAncientSansTC-Regular-subset.otf index ff4250351..f15582104 100644 Binary files a/sources/shs-classical-override/AdvocateAncientSansTC-Regular-subset.otf and b/sources/shs-classical-override/AdvocateAncientSansTC-Regular-subset.otf differ diff --git a/verdafile.mjs b/verdafile.mjs index e36b80548..ab9a352bd 100644 --- a/verdafile.mjs +++ b/verdafile.mjs @@ -16,7 +16,7 @@ const PREFIX = `Sarasa`; const BUILD = `.build`; const OUT = `out`; const SOURCES = `sources`; -const __dirname = url.fileURLToPath(new URL(".", import.meta.url)); +const PROJECT_ROOT = url.fileURLToPath(new URL(".", import.meta.url)); // Command line const NODEJS = `node`; @@ -37,10 +37,7 @@ build.setSelfTracking(); // Entrypoint const Start = phony("all", async t => { const version = await t.need(Version); - await t.need(TtfFontFiles`TTF`, TtfFontFiles`TTF-Unhinted`); - // Do in serial -- otherwise, memory usage will be too high. - await t.need(TtcFontFiles`TTC`); - await t.need(TtcFontFiles`TTC-Unhinted`); + await t.need(Ttf, Ttc); await t.need( TtcArchive(`TTC`, version), TtcArchive(`TTC-Unhinted`, version), @@ -56,10 +53,8 @@ const SuperTtc = phony(`super-ttc`, async target => { }); const Ttc = phony(`ttc`, async t => { - await t.need(TtfFontFiles`TTF`, TtfFontFiles`TTF-Unhinted`); - // Do in serial -- otherwise, memory usage will be too high. - await t.need(TtcFontFiles`TTC`); - await t.need(TtcFontFiles`TTC-Unhinted`); + await t.need(Ttf); + await t.need(TtcFontFiles`TTC`, TtcFontFiles`TTC-Unhinted`); }); const Ttf = phony(`ttf`, async t => { @@ -67,10 +62,12 @@ const Ttf = phony(`ttf`, async t => { }); const Dependencies = oracle("oracles::dependencies", async () => { - const pkg = await fs.readJSON(__dirname + "/package.json"); + const pkg = await fs.readJSON(path.resolve(PROJECT_ROOT, "package.json")); const depJson = {}; for (const pkgName in pkg.dependencies) { - const depPkg = await fs.readJSON(__dirname + "/node_modules/" + pkgName + "/package.json"); + const depPkg = await fs.readJSON( + path.resolve(PROJECT_ROOT, "node_modules", pkgName, "package.json") + ); const depVer = depPkg.version; depJson[pkgName] = depVer; } @@ -78,7 +75,7 @@ const Dependencies = oracle("oracles::dependencies", async () => { }); const Version = oracle("oracles::version", async t => { - return (await fs.readJson(path.resolve(__dirname, "package.json"))).version; + return (await fs.readJson(path.resolve(PROJECT_ROOT, "package.json"))).version; }); const SuperTtcArchive = file.make( @@ -269,6 +266,8 @@ const Pass1 = file.make( (family, region, style) => `${BUILD}/pass1/${family}-${region}-${style}.ttf`, async (t, out, family, region, style) => { const [config] = await t.need(Config, Scripts); + const version = await t.need(Version); + const latinFamily = config.families[family].latinGroup; const [, $1, $2, $3, $4] = await t.need( de(out.dir), @@ -289,6 +288,8 @@ const Pass1 = file.make( style: style, italize: deItalizedNameOf(config, out.name) === out.name ? false : true, + version, + ...flagsOfFamily(config, family) }); } @@ -323,7 +324,9 @@ const ProdUnhinted = file.make( ); async function MakeProd(t, out, family, region, style, fragT) { - const [config] = await t.need(Config, Scripts, Version, de(out.dir)); + const [config] = await t.need(Config, Scripts, de(out.dir)); + const version = await t.need(Version); + const weight = deItalizedNameOf(config, style); const [, $1, $2, $3] = await t.need( de(out.dir), @@ -337,7 +340,8 @@ async function MakeProd(t, out, family, region, style, fragT) { kanji: $2.full, hangul: $3.full, o: out.full, - italize: weight === style ? false : true + italize: weight === style ? false : true, + version }); } @@ -601,8 +605,8 @@ const Scripts = task("dep::scripts", async t => { }); const Config = oracle("dep::config", async () => { - const configPath = __dirname + "/config.json"; - const privateConfigPath = __dirname + "/config.private.json"; + const configPath = path.resolve(PROJECT_ROOT, "config.json"); + const privateConfigPath = path.resolve(PROJECT_ROOT, "config.private.json"); const config = await fs.readJSON(configPath); if (fs.existsSync(privateConfigPath)) { const privateConfig = await fs.readJSON(privateConfigPath);