From 4e9c3bce9d8e9fc87360a86ca77143af43a08116 Mon Sep 17 00:00:00 2001 From: Belleve Date: Sun, 21 Jul 2024 16:24:06 -1000 Subject: [PATCH] Eng: Unify the inclusion interface (#2426) * Unify inclusion interface * Version bump + sample update --- images/button-release.dark.svg | 7 +- images/button-release.light.svg | 7 +- ...mathematical-alphanumeric-symbols.dark.svg | 4 +- ...athematical-alphanumeric-symbols.light.svg | 4 +- images/cv-e-rounded.dark.svg | 2 +- images/cv-e-rounded.light.svg | 2 +- images/languages.dark.svg | 2 +- images/languages.light.svg | 2 +- images/ss-i-off-0.dark.svg | 2 +- images/ss-i-off-0.light.svg | 2 +- images/ss-i-ss03-1.dark.svg | 2 +- images/ss-i-ss03-1.light.svg | 2 +- images/ss-i-ss10-1.dark.svg | 2 +- images/ss-i-ss10-1.light.svg | 2 +- images/ss-i-ss11-1.dark.svg | 2 +- images/ss-i-ss11-1.light.svg | 2 +- images/ss-i-ss12-1.dark.svg | 2 +- images/ss-i-ss12-1.light.svg | 2 +- images/ss-i-ss14-1.dark.svg | 2 +- images/ss-i-ss14-1.light.svg | 2 +- images/ss-i-ss15-1.dark.svg | 2 +- images/ss-i-ss15-1.light.svg | 2 +- images/ss-i-ss17-1.dark.svg | 2 +- images/ss-i-ss17-1.light.svg | 2 +- images/ss-i-ss18-1.dark.svg | 2 +- images/ss-i-ss18-1.light.svg | 2 +- images/ss-i-ss20-1.dark.svg | 2 +- images/ss-i-ss20-1.light.svg | 2 +- package-lock.json | 208 +++++++++--------- package.json | 12 +- packages/font-glyphs/package.json | 12 +- .../font-glyphs/src/common/derivatives.ptl | 19 +- packages/font-glyphs/src/common/shapes.ptl | 31 ++- packages/font-glyphs/src/index.ptl | 4 +- packages/font-glyphs/src/meta/macros.ptl | 19 +- .../src/symbol/geometric/shared.ptl | 4 +- packages/font-glyphs/src/symbol/math/apl.ptl | 2 +- .../src/symbol/pictograph/stick-figure.ptl | 4 +- packages/font-kits/package.json | 8 +- packages/font-otl/package.json | 6 +- packages/font/package.json | 20 +- packages/geometry-cache/package.json | 4 +- packages/geometry/package.json | 4 +- packages/geometry/src/transform.mjs | 4 + packages/glyph/package.json | 4 +- packages/glyph/src/glyph.mjs | 49 +++-- packages/param/package.json | 4 +- packages/util/package.json | 2 +- tools/amend-readme/package.json | 4 +- tools/data-export/package.json | 4 +- tools/generate-samples/package.json | 4 +- tools/misc/package.json | 6 +- 52 files changed, 272 insertions(+), 236 deletions(-) diff --git a/images/button-release.dark.svg b/images/button-release.dark.svg index 632ac29f0..c2d2a3bed 100644 --- a/images/button-release.dark.svg +++ b/images/button-release.dark.svg @@ -9,6 +9,7 @@ + @@ -20,13 +21,13 @@ - + - + - + \ No newline at end of file diff --git a/images/button-release.light.svg b/images/button-release.light.svg index e941c69d8..2810b5fbd 100644 --- a/images/button-release.light.svg +++ b/images/button-release.light.svg @@ -9,6 +9,7 @@ + @@ -20,13 +21,13 @@ - + - + - + \ No newline at end of file diff --git a/images/cs-block-mathematical-alphanumeric-symbols.dark.svg b/images/cs-block-mathematical-alphanumeric-symbols.dark.svg index d376bca15..7ca80245b 100644 --- a/images/cs-block-mathematical-alphanumeric-symbols.dark.svg +++ b/images/cs-block-mathematical-alphanumeric-symbols.dark.svg @@ -101,7 +101,7 @@ - + @@ -153,7 +153,7 @@ - + diff --git a/images/cs-block-mathematical-alphanumeric-symbols.light.svg b/images/cs-block-mathematical-alphanumeric-symbols.light.svg index 6456b7b07..264cbf288 100644 --- a/images/cs-block-mathematical-alphanumeric-symbols.light.svg +++ b/images/cs-block-mathematical-alphanumeric-symbols.light.svg @@ -101,7 +101,7 @@ - + @@ -153,7 +153,7 @@ - + diff --git a/images/cv-e-rounded.dark.svg b/images/cv-e-rounded.dark.svg index 6542bb655..f1b5207d5 100644 --- a/images/cv-e-rounded.dark.svg +++ b/images/cv-e-rounded.dark.svg @@ -1,7 +1,7 @@ - + diff --git a/images/cv-e-rounded.light.svg b/images/cv-e-rounded.light.svg index 20cad63c4..052f41769 100644 --- a/images/cv-e-rounded.light.svg +++ b/images/cv-e-rounded.light.svg @@ -1,7 +1,7 @@ - + diff --git a/images/languages.dark.svg b/images/languages.dark.svg index 8c56ad923..1bb145198 100644 --- a/images/languages.dark.svg +++ b/images/languages.dark.svg @@ -68,7 +68,7 @@ - + diff --git a/images/languages.light.svg b/images/languages.light.svg index 667122aea..f1f6a90ca 100644 --- a/images/languages.light.svg +++ b/images/languages.light.svg @@ -68,7 +68,7 @@ - + diff --git a/images/ss-i-off-0.dark.svg b/images/ss-i-off-0.dark.svg index 18bce2e64..c970d0eae 100644 --- a/images/ss-i-off-0.dark.svg +++ b/images/ss-i-off-0.dark.svg @@ -32,7 +32,7 @@ - + diff --git a/images/ss-i-off-0.light.svg b/images/ss-i-off-0.light.svg index 3a0257ea8..f89c51748 100644 --- a/images/ss-i-off-0.light.svg +++ b/images/ss-i-off-0.light.svg @@ -32,7 +32,7 @@ - + diff --git a/images/ss-i-ss03-1.dark.svg b/images/ss-i-ss03-1.dark.svg index 477015ee7..9f1cb826c 100644 --- a/images/ss-i-ss03-1.dark.svg +++ b/images/ss-i-ss03-1.dark.svg @@ -32,7 +32,7 @@ - + diff --git a/images/ss-i-ss03-1.light.svg b/images/ss-i-ss03-1.light.svg index 217e168a1..2b54e2afa 100644 --- a/images/ss-i-ss03-1.light.svg +++ b/images/ss-i-ss03-1.light.svg @@ -32,7 +32,7 @@ - + diff --git a/images/ss-i-ss10-1.dark.svg b/images/ss-i-ss10-1.dark.svg index 1628f0f30..3dc6741c2 100644 --- a/images/ss-i-ss10-1.dark.svg +++ b/images/ss-i-ss10-1.dark.svg @@ -32,7 +32,7 @@ - + diff --git a/images/ss-i-ss10-1.light.svg b/images/ss-i-ss10-1.light.svg index 7a54baec7..469adecad 100644 --- a/images/ss-i-ss10-1.light.svg +++ b/images/ss-i-ss10-1.light.svg @@ -32,7 +32,7 @@ - + diff --git a/images/ss-i-ss11-1.dark.svg b/images/ss-i-ss11-1.dark.svg index df9c844c7..d0f008062 100644 --- a/images/ss-i-ss11-1.dark.svg +++ b/images/ss-i-ss11-1.dark.svg @@ -32,7 +32,7 @@ - + diff --git a/images/ss-i-ss11-1.light.svg b/images/ss-i-ss11-1.light.svg index 58077e2f9..dc2c85790 100644 --- a/images/ss-i-ss11-1.light.svg +++ b/images/ss-i-ss11-1.light.svg @@ -32,7 +32,7 @@ - + diff --git a/images/ss-i-ss12-1.dark.svg b/images/ss-i-ss12-1.dark.svg index 6f557ba55..1ff4377bc 100644 --- a/images/ss-i-ss12-1.dark.svg +++ b/images/ss-i-ss12-1.dark.svg @@ -32,7 +32,7 @@ - + diff --git a/images/ss-i-ss12-1.light.svg b/images/ss-i-ss12-1.light.svg index 25b059d09..0d8d2c14f 100644 --- a/images/ss-i-ss12-1.light.svg +++ b/images/ss-i-ss12-1.light.svg @@ -32,7 +32,7 @@ - + diff --git a/images/ss-i-ss14-1.dark.svg b/images/ss-i-ss14-1.dark.svg index 2e8a1139c..045e2e74b 100644 --- a/images/ss-i-ss14-1.dark.svg +++ b/images/ss-i-ss14-1.dark.svg @@ -32,7 +32,7 @@ - + diff --git a/images/ss-i-ss14-1.light.svg b/images/ss-i-ss14-1.light.svg index 444e449a5..9766a5b3e 100644 --- a/images/ss-i-ss14-1.light.svg +++ b/images/ss-i-ss14-1.light.svg @@ -32,7 +32,7 @@ - + diff --git a/images/ss-i-ss15-1.dark.svg b/images/ss-i-ss15-1.dark.svg index ac5db2445..3b200f9e2 100644 --- a/images/ss-i-ss15-1.dark.svg +++ b/images/ss-i-ss15-1.dark.svg @@ -32,7 +32,7 @@ - + diff --git a/images/ss-i-ss15-1.light.svg b/images/ss-i-ss15-1.light.svg index f9e830c24..0f8855a02 100644 --- a/images/ss-i-ss15-1.light.svg +++ b/images/ss-i-ss15-1.light.svg @@ -32,7 +32,7 @@ - + diff --git a/images/ss-i-ss17-1.dark.svg b/images/ss-i-ss17-1.dark.svg index 64ccdbd6d..1d6031259 100644 --- a/images/ss-i-ss17-1.dark.svg +++ b/images/ss-i-ss17-1.dark.svg @@ -32,7 +32,7 @@ - + diff --git a/images/ss-i-ss17-1.light.svg b/images/ss-i-ss17-1.light.svg index 0d8379620..d2ab59d78 100644 --- a/images/ss-i-ss17-1.light.svg +++ b/images/ss-i-ss17-1.light.svg @@ -32,7 +32,7 @@ - + diff --git a/images/ss-i-ss18-1.dark.svg b/images/ss-i-ss18-1.dark.svg index fe7b486a9..38599ec15 100644 --- a/images/ss-i-ss18-1.dark.svg +++ b/images/ss-i-ss18-1.dark.svg @@ -32,7 +32,7 @@ - + diff --git a/images/ss-i-ss18-1.light.svg b/images/ss-i-ss18-1.light.svg index 18c4f9695..0519a264f 100644 --- a/images/ss-i-ss18-1.light.svg +++ b/images/ss-i-ss18-1.light.svg @@ -32,7 +32,7 @@ - + diff --git a/images/ss-i-ss20-1.dark.svg b/images/ss-i-ss20-1.dark.svg index a4a9c2028..ac74cddae 100644 --- a/images/ss-i-ss20-1.dark.svg +++ b/images/ss-i-ss20-1.dark.svg @@ -32,7 +32,7 @@ - + diff --git a/images/ss-i-ss20-1.light.svg b/images/ss-i-ss20-1.light.svg index 9fe7ee523..400481530 100644 --- a/images/ss-i-ss20-1.light.svg +++ b/images/ss-i-ss20-1.light.svg @@ -32,7 +32,7 @@ - + diff --git a/package-lock.json b/package-lock.json index deff30fa0..555420bef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@iosevka/monorepo", - "version": "30.3.3", + "version": "30.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@iosevka/monorepo", - "version": "30.3.3", + "version": "30.4.0", "workspaces": [ "packages/*", "tools/*" @@ -15,18 +15,18 @@ "@iarna/toml": "^2.2.5", "deep-equal": "^2.2.3", "otb-ttc-bundle": "^1.7.4", - "semver": "^7.6.2", + "semver": "^7.6.3", "uuid": "^10.0.0", "verda": "^1.12.2", "which": "^4.0.0" }, "devDependencies": { - "eslint": "^9.6.0", + "eslint": "^9.7.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-prettier": "^5.1.3", - "glob": "^10.4.2", + "eslint-plugin-prettier": "^5.2.1", + "glob": "^11.0.0", "patel": "^0.40.0", - "prettier": "^3.3.2" + "prettier": "^3.3.3" }, "engines": { "node": ">=16.0.0" @@ -106,9 +106,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.6.0.tgz", - "integrity": "sha512-D9B0/3vNg44ZeWbYMpBoXqNP4j6eQD5vNwIlGAuFRRzK/WtT/jvDQW3Bi9kkf3PMDMlM7Yi+73VLUsn5bJcl8A==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.7.0.tgz", + "integrity": "sha512-ChuWDQenef8OSFnvuxv0TCVxEwmu3+hPNKvM9B34qpM0rDRbjL8t5QkQeHHeAfsKQjuH9wS82WeCi1J/owatng==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1467,16 +1467,16 @@ } }, "node_modules/eslint": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.6.0.tgz", - "integrity": "sha512-ElQkdLMEEqQNM9Njff+2Y4q2afHk7JpkPvrd7Xh7xefwgQynqPxwf55J7di9+MEibWUGdNjFF9ITG9Pck5M84w==", + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.7.0.tgz", + "integrity": "sha512-FzJ9D/0nGiCGBf8UXO/IGLTgLVzIxze1zpfA8Ton2mjLovXdAPlYDv+MQDcqj3TmrhAGYfOpz9RfR+ent0AgAw==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", + "@eslint-community/regexpp": "^4.11.0", "@eslint/config-array": "^0.17.0", "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.6.0", + "@eslint/js": "9.7.0", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.3.0", "@nodelib/fs.walk": "^1.2.8", @@ -1485,7 +1485,7 @@ "cross-spawn": "^7.0.2", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.0.1", + "eslint-scope": "^8.0.2", "eslint-visitor-keys": "^4.0.0", "espree": "^10.1.0", "esquery": "^1.5.0", @@ -1530,13 +1530,13 @@ } }, "node_modules/eslint-plugin-prettier": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz", - "integrity": "sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", + "integrity": "sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==", "dev": true, "dependencies": { "prettier-linter-helpers": "^1.0.0", - "synckit": "^0.8.6" + "synckit": "^0.9.1" }, "engines": { "node": "^14.18.0 || >=16.0.0" @@ -1560,9 +1560,9 @@ } }, "node_modules/eslint-scope": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.1.tgz", - "integrity": "sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.2.tgz", + "integrity": "sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", @@ -1617,9 +1617,9 @@ } }, "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, "dependencies": { "estraverse": "^5.1.0" @@ -1827,23 +1827,23 @@ } }, "node_modules/glob": { - "version": "10.4.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.2.tgz", - "integrity": "sha512-GwMlUF6PkPo3Gk21UxkCohOv0PLcIXVtKyLlpEI28R/cO/4eNOdmLk3CMW1wROV/WR/EsZOWAfBbBOqYvs88/w==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", + "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", + "jackspeak": "^4.0.1", + "minimatch": "^10.0.0", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" + "path-scurry": "^2.0.0" }, "bin": { "glob": "dist/esm/bin.mjs" }, "engines": { - "node": ">=16 || 14 >=14.18" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -1871,15 +1871,15 @@ } }, "node_modules/glob/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", + "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -1914,9 +1914,9 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, "node_modules/harfbuzzjs": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/harfbuzzjs/-/harfbuzzjs-0.3.5.tgz", - "integrity": "sha512-SbNxmVAyhlUJTHdaxgK5S6Uqy4mXIu80Vl6KDn8d+ctPAF6W3DY2yehB4BwIC24I/Tk5HGLjaQkyny5gY0r41Q==" + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/harfbuzzjs/-/harfbuzzjs-0.3.6.tgz", + "integrity": "sha512-dzf7y6NS8fiAIvPAL/VKwY8wx2HCzUB0vUfOo6h1J5UilFEEf7iYqFsvgwjHwvM3whbjfOMadNvQekU3KuRnWQ==" }, "node_modules/has-bigints": { "version": "1.0.2", @@ -2314,15 +2314,15 @@ } }, "node_modules/jackspeak": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.0.tgz", - "integrity": "sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.1.tgz", + "integrity": "sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==", "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" }, "engines": { - "node": ">=14" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -2421,12 +2421,12 @@ "dev": true }, "node_modules/lru-cache": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.3.0.tgz", - "integrity": "sha512-CQl19J/g+Hbjbv4Y3mFNNXFEL/5t/KCg8POCuUqd4rMKjGG+j1ybER83hxV58zL+dFI1PTkt3GNFSHRt+d8qEQ==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.0.tgz", + "integrity": "sha512-Qv32eSV1RSCfhY3fpPE2GNZ8jgM9X7rdAfemLWqTUxwiyIC4jJ6Sy0fZ8H+oLWevO6i4/bizg7c8d8i6bxrzbA==", "dev": true, "engines": { - "node": "14 || >=16.14" + "node": "20 || >=22" } }, "node_modules/memoizeasync": { @@ -2717,16 +2717,16 @@ } }, "node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", + "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", "dev": true, "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" }, "engines": { - "node": ">=16 || 14 >=14.18" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -2789,9 +2789,9 @@ } }, "node_modules/prettier": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", - "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -2960,9 +2960,9 @@ } }, "node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "bin": { "semver": "bin/semver.js" }, @@ -3209,9 +3209,9 @@ } }, "node_modules/synckit": { - "version": "0.8.8", - "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.8.tgz", - "integrity": "sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.1.tgz", + "integrity": "sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==", "dev": true, "dependencies": { "@pkgr/core": "^0.1.0", @@ -3663,118 +3663,118 @@ }, "packages/font": { "name": "@iosevka/font", - "version": "30.3.3", + "version": "30.4.0", "dependencies": { "@iarna/toml": "^2.2.5", - "@iosevka/font-glyphs": "30.3.3", - "@iosevka/font-otl": "30.3.3", - "@iosevka/geometry": "30.3.3", - "@iosevka/geometry-cache": "30.3.3", - "@iosevka/glyph": "30.3.3", - "@iosevka/param": "30.3.3", - "@iosevka/util": "30.3.3", - "harfbuzzjs": "^0.3.5", + "@iosevka/font-glyphs": "30.4.0", + "@iosevka/font-otl": "30.4.0", + "@iosevka/geometry": "30.4.0", + "@iosevka/geometry-cache": "30.4.0", + "@iosevka/glyph": "30.4.0", + "@iosevka/param": "30.4.0", + "@iosevka/util": "30.4.0", + "harfbuzzjs": "^0.3.6", "ot-builder": "^1.7.4", - "semver": "^7.6.2" + "semver": "^7.6.3" } }, "packages/font-glyphs": { "name": "@iosevka/font-glyphs", - "version": "30.3.3", + "version": "30.4.0", "dependencies": { - "@iosevka/font-kits": "30.3.3", - "@iosevka/geometry": "30.3.3", - "@iosevka/geometry-cache": "30.3.3", - "@iosevka/glyph": "30.3.3", - "@iosevka/util": "30.3.3", + "@iosevka/font-kits": "30.4.0", + "@iosevka/geometry": "30.4.0", + "@iosevka/geometry-cache": "30.4.0", + "@iosevka/glyph": "30.4.0", + "@iosevka/util": "30.4.0", "typo-geom": "^0.16.1" } }, "packages/font-kits": { "name": "@iosevka/font-kits", - "version": "30.3.3", + "version": "30.4.0", "dependencies": { - "@iosevka/geometry": "30.3.3", - "@iosevka/glyph": "30.3.3", - "@iosevka/util": "30.3.3" + "@iosevka/geometry": "30.4.0", + "@iosevka/glyph": "30.4.0", + "@iosevka/util": "30.4.0" } }, "packages/font-otl": { "name": "@iosevka/font-otl", - "version": "30.3.3", + "version": "30.4.0", "dependencies": { - "@iosevka/font-glyphs": "30.3.3", - "@iosevka/glyph": "30.3.3", + "@iosevka/font-glyphs": "30.4.0", + "@iosevka/glyph": "30.4.0", "toposort": "^2.0.2" } }, "packages/geometry": { "name": "@iosevka/geometry", - "version": "30.3.3", + "version": "30.4.0", "dependencies": { - "@iosevka/util": "30.3.3", + "@iosevka/util": "30.4.0", "spiro": "^3.0.1", "typo-geom": "^0.16.1" } }, "packages/geometry-cache": { "name": "@iosevka/geometry-cache", - "version": "30.3.3", + "version": "30.4.0", "dependencies": { - "@iosevka/geometry": "30.3.3", + "@iosevka/geometry": "30.4.0", "@msgpack/msgpack": "^2.8.0" } }, "packages/glyph": { "name": "@iosevka/glyph", - "version": "30.3.3", + "version": "30.4.0", "dependencies": { - "@iosevka/geometry": "30.3.3" + "@iosevka/geometry": "30.4.0" } }, "packages/param": { "name": "@iosevka/param", - "version": "30.3.3", + "version": "30.4.0", "dependencies": { - "@iosevka/util": "30.3.3" + "@iosevka/util": "30.4.0" } }, "packages/util": { "name": "@iosevka/util", - "version": "30.3.3" + "version": "30.4.0" }, "tools/amend-readme": { "name": "@iosevka/amend-readme", - "version": "30.3.3", + "version": "30.4.0", "dependencies": { "@iarna/toml": "^2.2.5", - "@iosevka/param": "30.3.3", + "@iosevka/param": "30.4.0", "@unicode/unicode-15.1.0": "^1.5.2" } }, "tools/data-export": { "name": "@iosevka/data-export", - "version": "30.3.3", + "version": "30.4.0", "dependencies": { "@iarna/toml": "^2.2.5", - "@iosevka/param": "30.3.3", + "@iosevka/param": "30.4.0", "@unicode/unicode-15.1.0": "^1.5.2", "cldr": "^7.5.0" } }, "tools/generate-samples": { "name": "@iosevka/generate-samples", - "version": "30.3.3", + "version": "30.4.0", "dependencies": { - "@iosevka/data-export": "30.3.3" + "@iosevka/data-export": "30.4.0" } }, "tools/misc": { "name": "@iosevka/misc", - "version": "30.3.3", + "version": "30.4.0", "dependencies": { - "@iosevka/util": "30.3.3", - "semver": "^7.6.2", + "@iosevka/util": "30.4.0", + "semver": "^7.6.3", "wawoff2": "^2.0.1" } } diff --git a/package.json b/package.json index 68a209214..cf33aa0ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@iosevka/monorepo", - "version": "30.3.3", + "version": "30.4.0", "workspaces": [ "packages/*", "tools/*" @@ -17,18 +17,18 @@ "@iarna/toml": "^2.2.5", "deep-equal": "^2.2.3", "otb-ttc-bundle": "^1.7.4", - "semver": "^7.6.2", + "semver": "^7.6.3", "uuid": "^10.0.0", "verda": "^1.12.2", "which": "^4.0.0" }, "devDependencies": { - "eslint": "^9.6.0", + "eslint": "^9.7.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-prettier": "^5.1.3", - "glob": "^10.4.2", + "eslint-plugin-prettier": "^5.2.1", + "glob": "^11.0.0", "patel": "^0.40.0", - "prettier": "^3.3.2" + "prettier": "^3.3.3" }, "engines": { "node": ">=16.0.0" diff --git a/packages/font-glyphs/package.json b/packages/font-glyphs/package.json index 21710bb90..91e89f3e7 100644 --- a/packages/font-glyphs/package.json +++ b/packages/font-glyphs/package.json @@ -1,6 +1,6 @@ { "name": "@iosevka/font-glyphs", - "version": "30.3.3", + "version": "30.4.0", "private": true, "exports": { ".": "./src/index.mjs", @@ -8,11 +8,11 @@ "./unicode-knowledge": "./src/meta/unicode-knowledge.mjs" }, "dependencies": { - "@iosevka/font-kits": "30.3.3", - "@iosevka/geometry": "30.3.3", - "@iosevka/geometry-cache": "30.3.3", - "@iosevka/glyph": "30.3.3", - "@iosevka/util": "30.3.3", + "@iosevka/font-kits": "30.4.0", + "@iosevka/geometry": "30.4.0", + "@iosevka/geometry-cache": "30.4.0", + "@iosevka/glyph": "30.4.0", + "@iosevka/util": "30.4.0", "typo-geom": "^0.16.1" } } diff --git a/packages/font-glyphs/src/common/derivatives.ptl b/packages/font-glyphs/src/common/derivatives.ptl index d5eb8ea48..45857645c 100644 --- a/packages/font-glyphs/src/common/derivatives.ptl +++ b/packages/font-glyphs/src/common/derivatives.ptl @@ -42,7 +42,7 @@ glyph-block Common-Derivatives : begin foreach gr [items-of SvInheritableRelations] : begin local v : gr.get fromGlyph - if v : gr.set this v + if v : gr.set currentGlyph v glyph-block-export orthographic-italic define [orthographic-italic name unicode] : if para.isItalic @@ -60,10 +60,15 @@ glyph-block Common-Derivatives : begin return : glyphStore.queryByName id glyph-block-export refer-glyph - define [refer-glyph id] : lambda [copyAnchors copyWidth] : begin - local goal : query-glyph id - if [not goal] : throw : new Error "Cannot find glyph '\(id)'" - this.includeGlyph goal copyAnchors copyWidth + define [refer-glyph id] : new ReferGlyph id + + class ReferGlyph + public [new id] : begin + set this.id id + public [applyToGlyph target copyAnchors copyWidth] : begin + local goal : query-glyph this.id + if [not goal] : throw : new Error "Cannot find glyph '\(this.id)'" + target.includeGlyph goal copyAnchors copyWidth glyph-block-export DeriveMeshT define [DeriveMeshT gnSources Query Fn FnLink] : begin @@ -146,11 +151,11 @@ glyph-block Common-Derivatives : begin # This is [FlipAround], but we cannot use it because common-shapes depends on this # glyph block - include [this.gizmo.inverse] + include [currentGlyph.gizmo.inverse] include : Translate (-x) (-y) include : Scale (-1) (-1) include : Translate x y - include this.gizmo + include currentGlyph.gizmo glyph-block-export link-reduced-variant define [link-reduced-variant] : with-params [dstGid srcGid gr follow shapeFrom] : begin diff --git a/packages/font-glyphs/src/common/shapes.ptl b/packages/font-glyphs/src/common/shapes.ptl index 5c530b354..08f20476f 100644 --- a/packages/font-glyphs/src/common/shapes.ptl +++ b/packages/font-glyphs/src/common/shapes.ptl @@ -11,15 +11,22 @@ glyph-block CommonShapes : begin glyph-block-import Common-Derivatives glyph-block-export no-shape - define [no-shape] { .__isNoShape true } + define [no-shape] [new NoShape] + class NoShape : public [applyToGlyph] : begin glyph-block-export tagged - define [tagged tag component] : function [ca cw] : begin - define t this.ctxTag - set this.ctxTag tag - define ret : this.include component ca cw - set this.ctxTag t - return ret + define [tagged tag component] : new TagComponentProc tag component + + class TagComponentProc + public [new tag component] : begin + set this.tag tag + set this.component component + public [applyToGlyph target copyAnchors copyMetrics] : begin + local t target.ctxTag + set target.ctxTag this.tag + local ret : target.include this.component copyAnchors copyMetrics + set target.ctxTag t + return ret glyph-block-export Rect define [Rect u d l r transformShiftOnly] : glyph-proc @@ -621,11 +628,11 @@ glyph-block CommonShapes : begin glyph-block-export Ungizmo define [Ungizmo] : glyph-proc - include [this.gizmo.inverse] + include [currentGlyph.gizmo.inverse] glyph-block-export Regizmo define [Regizmo] : glyph-proc - include this.gizmo + include currentGlyph.gizmo # Composite transformations glyph-block-export FlipAround @@ -643,7 +650,7 @@ glyph-block CommonShapes : begin define [Realign x y sx sy] : ApparentTranslate (sx - x) (sy - y) glyph-block-export ForceUpright - define [ForceUpright] : glyph-proc [set this.gizmo : Transform.Id] + define [ForceUpright] : glyph-proc [set currentGlyph.gizmo : Transform.Id] glyph-block-export NameUni define [NameUni unicode] : begin @@ -653,9 +660,9 @@ glyph-block CommonShapes : begin glyph-block-export PointingTo define [PointingTo x1 y1 x2 y2 G] : glyph-proc - local giz this.gizmo + local giz currentGlyph.gizmo local g : new-glyph : glyph-proc - set this.gizmo : Transform.Id + set currentGlyph.gizmo : Transform.Id local {.x xo .y yo} : [Transform.Id].apply {.x x1 .y y1} local {.x xt .y yt} : [Transform.Id].apply {.x x2 .y y2} local mag : Math.hypot (yo - yt) (xo - xt) diff --git a/packages/font-glyphs/src/index.ptl b/packages/font-glyphs/src/index.ptl index ad81981eb..45410148b 100644 --- a/packages/font-glyphs/src/index.ptl +++ b/packages/font-glyphs/src/index.ptl @@ -1,4 +1,4 @@ -import [Glyph] from "@iosevka/glyph" +import [Glyph GlyphProc ForkGlyphProc] from "@iosevka/glyph" import [GlyphStore] from "@iosevka/glyph/store" import [GlyphBlock GlyphBuildExecutor] from "@iosevka/glyph/block" import as Gr from "@iosevka/glyph/relation" @@ -100,6 +100,8 @@ export : define [buildGlyphs para recursive] : begin glyph-is-needed buildGlyphs fontMetrics + GlyphProc + ForkGlyphProc ### HERE WE GO run-glyph-module "./common/derivatives.mjs" diff --git a/packages/font-glyphs/src/meta/macros.ptl b/packages/font-glyphs/src/meta/macros.ptl index 23dab4d53..848eee208 100644 --- a/packages/font-glyphs/src/meta/macros.ptl +++ b/packages/font-glyphs/src/meta/macros.ptl @@ -108,15 +108,15 @@ define-macro flex-params : syntax-rules ### Necessary macros # A glyph construction is a function which "modifies" a glyph. define-macro glyph-proc : syntax-rules - `[glyph-proc @::steps] : dirty `[lambda [] [begin \\ - local currentGlyph this + `[glyph-proc @::steps] : dirty `[new $Capture$.GlyphProc : function [currentGlyph] [begin \\ + # local currentGlyph this begin @::[steps.map formOf] return nothing ]] define-macro composite-proc : syntax-rules - `[composite-proc @::steps] : dirty `[lambda [] [begin \\ - local currentGlyph this + `[composite-proc @::steps] : dirty `[new $Capture$.GlyphProc : function [currentGlyph] [begin \\ + # local currentGlyph this begin @::[steps.map : lambda [x j] : if j `[include @[formOf x]] `[include @[formOf x] true true]] return nothing ]] @@ -154,9 +154,8 @@ define-macro create-aliased-glyph : syntax-rules `[create-aliased-glyph @name] : begin dirty `[create-aliased-glyph @[formOf name] null] `[create-aliased-glyph @name @code] : begin - dirty `[$createAndSaveGlyphImpl$ @[formOf name] @[formOf code] [lambda : begin - [this.include currentGlyph true true] - [this.cloneRankFromGlyph currentGlyph] ]] + dirty `[$createAndSaveGlyphImpl$ @[formOf name] @[formOf code] + [new $Capture$.ForkGlyphProc currentGlyph null] ] define-macro create-forked-glyph : syntax-rules `[create-forked-glyph @body] : begin @@ -168,10 +167,8 @@ define-macro create-forked-glyph : syntax-rules `[create-forked-glyph @name @body] : begin dirty `[create-forked-glyph @[formOf name] null @[formOf body]] `[create-forked-glyph @name @code @body] : begin - dirty `[$createAndSaveGlyphImpl$ @[formOf name] @[formOf code] [lambda : begin - [this.include currentGlyph true true] - [this.cloneRankFromGlyph currentGlyph] - [this.include @[formOf body]] ]] + dirty `[$createAndSaveGlyphImpl$ @[formOf name] @[formOf code] + [new $Capture$.ForkGlyphProc currentGlyph @[formOf body]] ] ###### Glyph modules and Glyph blocks diff --git a/packages/font-glyphs/src/symbol/geometric/shared.ptl b/packages/font-glyphs/src/symbol/geometric/shared.ptl index 6e9de41f2..8fb4d3047 100644 --- a/packages/font-glyphs/src/symbol/geometric/shared.ptl +++ b/packages/font-glyphs/src/symbol/geometric/shared.ptl @@ -63,8 +63,8 @@ glyph-block Symbol-Geometric-Shared : begin define [pointsAreNotClose a b] : begin return : [Math.abs (a.x - b.x)] > OCCURRENT_PRECISION || [Math.abs (a.y - b.y)] > OCCURRENT_PRECISION define [ConvexPolygonOutline shape sw] : begin - local outlines : glyph-proc : begin - set this.gizmo : Translate 0 0 + local outlines : glyph-proc + set currentGlyph.gizmo : Translate 0 0 foreach c [items-of : shape.geometry.toContours] : foreach j [range 0 c.length] : begin local a c.[if j (j - 1) (c.length - 1)] local b c.(j) diff --git a/packages/font-glyphs/src/symbol/math/apl.ptl b/packages/font-glyphs/src/symbol/math/apl.ptl index b29f15adf..d77c65236 100644 --- a/packages/font-glyphs/src/symbol/math/apl.ptl +++ b/packages/font-glyphs/src/symbol/math/apl.ptl @@ -29,7 +29,7 @@ glyph-block Symbol-Math-APL : begin define background : new-glyph : glyph-proc : include fnBackground AS_BASE ALSO_METRICS local corners : new-glyph : glyph-proc - set this.gizmo : Translate 0 0 + set currentGlyph.gizmo : Translate 0 0 foreach [c : items-of : overlay.geometry.toContours] : foreach [z : items-of c] : do if (z.type === Point.Type.Corner) : begin define x z.x diff --git a/packages/font-glyphs/src/symbol/pictograph/stick-figure.ptl b/packages/font-glyphs/src/symbol/pictograph/stick-figure.ptl index 71a4d29e6..23af04a35 100644 --- a/packages/font-glyphs/src/symbol/pictograph/stick-figure.ptl +++ b/packages/font-glyphs/src/symbol/pictograph/stick-figure.ptl @@ -19,8 +19,8 @@ glyph-block Symbol-Pictograph-Stick-Figure : begin Rotate ((rot / 2) * Math.PI) Translate (+midx) (+SymbolMid) define [WithD4Transform midx rot refl shapeFunc] : new-glyph : glyph-proc - local giz this.gizmo - set this.gizmo : Transform.Id + local giz currentGlyph.gizmo + set currentGlyph.gizmo : Transform.Id include : shapeFunc include : D4Transform midx rot refl include giz diff --git a/packages/font-kits/package.json b/packages/font-kits/package.json index b81317f7b..216a05251 100644 --- a/packages/font-kits/package.json +++ b/packages/font-kits/package.json @@ -1,14 +1,14 @@ { "name": "@iosevka/font-kits", - "version": "30.3.3", + "version": "30.4.0", "private": true, "exports": { "./boole-kit": "./src/boole-kit.mjs", "./spiro-kit": "./src/spiro-kit.mjs" }, "dependencies": { - "@iosevka/geometry": "30.3.3", - "@iosevka/glyph": "30.3.3", - "@iosevka/util": "30.3.3" + "@iosevka/geometry": "30.4.0", + "@iosevka/glyph": "30.4.0", + "@iosevka/util": "30.4.0" } } diff --git a/packages/font-otl/package.json b/packages/font-otl/package.json index 80f4345d8..b2b78f0e0 100644 --- a/packages/font-otl/package.json +++ b/packages/font-otl/package.json @@ -1,13 +1,13 @@ { "name": "@iosevka/font-otl", - "version": "30.3.3", + "version": "30.4.0", "private": true, "exports": { ".": "./src/index.mjs" }, "dependencies": { - "@iosevka/font-glyphs": "30.3.3", - "@iosevka/glyph": "30.3.3", + "@iosevka/font-glyphs": "30.4.0", + "@iosevka/glyph": "30.4.0", "toposort": "^2.0.2" } } diff --git a/packages/font/package.json b/packages/font/package.json index e2a0ab65b..e1f2cc4dd 100644 --- a/packages/font/package.json +++ b/packages/font/package.json @@ -1,6 +1,6 @@ { "name": "@iosevka/font", - "version": "30.3.3", + "version": "30.4.0", "private": true, "exports": { ".": "./src/index.mjs", @@ -10,15 +10,15 @@ }, "dependencies": { "@iarna/toml": "^2.2.5", - "@iosevka/font-glyphs": "30.3.3", - "@iosevka/font-otl": "30.3.3", - "@iosevka/geometry": "30.3.3", - "@iosevka/geometry-cache": "30.3.3", - "@iosevka/glyph": "30.3.3", - "@iosevka/param": "30.3.3", - "@iosevka/util": "30.3.3", - "harfbuzzjs": "^0.3.5", + "@iosevka/font-glyphs": "30.4.0", + "@iosevka/font-otl": "30.4.0", + "@iosevka/geometry": "30.4.0", + "@iosevka/geometry-cache": "30.4.0", + "@iosevka/glyph": "30.4.0", + "@iosevka/param": "30.4.0", + "@iosevka/util": "30.4.0", + "harfbuzzjs": "^0.3.6", "ot-builder": "^1.7.4", - "semver": "^7.6.2" + "semver": "^7.6.3" } } diff --git a/packages/geometry-cache/package.json b/packages/geometry-cache/package.json index 1929d04ab..a9826f2ba 100644 --- a/packages/geometry-cache/package.json +++ b/packages/geometry-cache/package.json @@ -1,12 +1,12 @@ { "name": "@iosevka/geometry-cache", - "version": "30.3.3", + "version": "30.4.0", "private": true, "exports": { ".": "./src/index.mjs" }, "dependencies": { - "@iosevka/geometry": "30.3.3", + "@iosevka/geometry": "30.4.0", "@msgpack/msgpack": "^2.8.0" } } diff --git a/packages/geometry/package.json b/packages/geometry/package.json index fab2e2e5f..dd2ebf5bd 100644 --- a/packages/geometry/package.json +++ b/packages/geometry/package.json @@ -1,6 +1,6 @@ { "name": "@iosevka/geometry", - "version": "30.3.3", + "version": "30.4.0", "private": true, "exports": { ".": "./src/index.mjs", @@ -13,7 +13,7 @@ "./spiro-control": "./src/spiro-control.mjs" }, "dependencies": { - "@iosevka/util": "30.3.3", + "@iosevka/util": "30.4.0", "spiro": "^3.0.1", "typo-geom": "^0.16.1" } diff --git a/packages/geometry/src/transform.mjs b/packages/geometry/src/transform.mjs index 5d1e98b00..c67ebadae 100644 --- a/packages/geometry/src/transform.mjs +++ b/packages/geometry/src/transform.mjs @@ -71,6 +71,10 @@ export class Transform { ); } + applyToGlyph(g, alsoAnchors) { + g.applyTransform(this, alsoAnchors); + } + toString() { return `[[${this.xx} ${this.yx}] [${this.xy} ${this.yy}]] + [[${this.tx}] [${this.ty}]]`; } diff --git a/packages/glyph/package.json b/packages/glyph/package.json index 2f18e868f..d4c740857 100644 --- a/packages/glyph/package.json +++ b/packages/glyph/package.json @@ -1,6 +1,6 @@ { "name": "@iosevka/glyph", - "version": "30.3.3", + "version": "30.4.0", "private": true, "exports": { ".": "./src/glyph.mjs", @@ -9,6 +9,6 @@ "./relation": "./src/relation.mjs" }, "dependencies": { - "@iosevka/geometry": "30.3.3" + "@iosevka/geometry": "30.4.0" } } diff --git a/packages/glyph/src/glyph.mjs b/packages/glyph/src/glyph.mjs index 24677f2e6..6f67b000e 100644 --- a/packages/glyph/src/glyph.mjs +++ b/packages/glyph/src/glyph.mjs @@ -89,21 +89,13 @@ export class Glyph { // Inclusion include(component, copyAnchors, copyWidth) { - if (!component) { - throw new Error("Unreachable: Attempt to include a Null or Undefined"); - } else if (component.applyToGlyph instanceof Function) { - return component.applyToGlyph(this, copyAnchors, copyWidth); - } else if (component instanceof Function) { - return component.call(this, copyAnchors, copyWidth); - } else if (component instanceof Transform) { - return this.applyTransform(component, copyAnchors); - } else if (component instanceof Glyph) { - return this.includeGlyph(component, copyAnchors, copyWidth); - } else if (component.__isNoShape) { - // Do nothing. By design. - } else { - throw new Error("Invalid component to be introduced."); - } + if (!component) throw new Error("Unreachable: Attempt to include a Null or Undefined"); + return component.applyToGlyph(this, copyAnchors, copyWidth); + } + + // Glyph inclusion + applyToGlyph(g, copyAnchors, copyWidth) { + g.includeGlyph(this, copyAnchors, copyWidth); } includeGlyph(g, copyAnchors, copyWidth) { if (g instanceof Function) throw new Error("Unreachable"); @@ -129,6 +121,8 @@ export class Glyph { ); } } + + // Geometry inclusion includeGeometry(g) { let deps = g.getDependencies(); if (deps && deps.length) for (const dep of deps) this.dependsOn(dep); @@ -138,6 +132,8 @@ export class Glyph { includeContours(cs) { this.includeGeometry(new Geom.ContourSetGeometry(cs)); } + + // Transform inclusion applyTransform(tfm, alsoAnchors) { this.geometry = Geom.TransformedGeometry.create(tfm, this.geometry); if (alsoAnchors) { @@ -147,6 +143,7 @@ export class Glyph { this.markAnchors[k] = Anchor.transform(tfm, this.markAnchors[k]); } } + tryBecomeMirrorOf(dst, rankSet) { if (rankSet.has(this) || rankSet.has(dst)) return; if (dst.hasDependency(this)) return; @@ -163,6 +160,7 @@ export class Glyph { ejectTagged(tag) { this.geometry = this.geometry.filterTag(t => tag !== t); } + // Anchors combineMarks(g, shift, lm) { if (!g.markAnchors) return; @@ -245,3 +243,24 @@ export class Glyph { delete this.markAnchors[id]; } } + +export class GlyphProc { + constructor(fn) { + this.m_fn = fn; + } + applyToGlyph(g, copyAnchors, copyWidth) { + return this.m_fn.call(null, g, copyAnchors, copyWidth); + } +} + +export class ForkGlyphProc { + constructor(fromGlyph, component) { + this.m_fromGlyph = fromGlyph; + this.m_component = component; + } + applyToGlyph(g) { + g.include(this.m_fromGlyph, true, true); + g.cloneRankFromGlyph(this.m_fromGlyph); + if (this.m_component) g.include(this.m_component, true, true); + } +} diff --git a/packages/param/package.json b/packages/param/package.json index 616eb8590..e5e3a1fbf 100644 --- a/packages/param/package.json +++ b/packages/param/package.json @@ -1,6 +1,6 @@ { "name": "@iosevka/param", - "version": "30.3.3", + "version": "30.4.0", "private": true, "exports": { ".": "./src/index.mjs", @@ -9,6 +9,6 @@ "./metric-override": "./src/metric-override.mjs" }, "dependencies": { - "@iosevka/util": "30.3.3" + "@iosevka/util": "30.4.0" } } diff --git a/packages/util/package.json b/packages/util/package.json index b7c9e62e7..59ac5f4fa 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "@iosevka/util", - "version": "30.3.3", + "version": "30.4.0", "private": true, "exports": { ".": "./src/index.mjs", diff --git a/tools/amend-readme/package.json b/tools/amend-readme/package.json index 785a518ab..304b4d347 100644 --- a/tools/amend-readme/package.json +++ b/tools/amend-readme/package.json @@ -1,13 +1,13 @@ { "name": "@iosevka/amend-readme", - "version": "30.3.3", + "version": "30.4.0", "private": true, "exports": { ".": "./src/index.mjs" }, "dependencies": { "@iarna/toml": "^2.2.5", - "@iosevka/param": "30.3.3", + "@iosevka/param": "30.4.0", "@unicode/unicode-15.1.0": "^1.5.2" } } diff --git a/tools/data-export/package.json b/tools/data-export/package.json index b65d55247..12f49d148 100644 --- a/tools/data-export/package.json +++ b/tools/data-export/package.json @@ -1,6 +1,6 @@ { "name": "@iosevka/data-export", - "version": "30.3.3", + "version": "30.4.0", "private": true, "exports": { ".": "./src/index.mjs", @@ -10,7 +10,7 @@ }, "dependencies": { "@iarna/toml": "^2.2.5", - "@iosevka/param": "30.3.3", + "@iosevka/param": "30.4.0", "@unicode/unicode-15.1.0": "^1.5.2", "cldr": "^7.5.0" } diff --git a/tools/generate-samples/package.json b/tools/generate-samples/package.json index 0fd2ccf96..28b078800 100644 --- a/tools/generate-samples/package.json +++ b/tools/generate-samples/package.json @@ -1,11 +1,11 @@ { "name": "@iosevka/generate-samples", - "version": "30.3.3", + "version": "30.4.0", "private": true, "exports": { ".": "./src/index.mjs" }, "dependencies": { - "@iosevka/data-export": "30.3.3" + "@iosevka/data-export": "30.4.0" } } diff --git a/tools/misc/package.json b/tools/misc/package.json index 3d44c9a22..8a71c2a3b 100644 --- a/tools/misc/package.json +++ b/tools/misc/package.json @@ -1,10 +1,10 @@ { "name": "@iosevka/misc", - "version": "30.3.3", + "version": "30.4.0", "private": true, "dependencies": { - "semver": "^7.6.2", + "semver": "^7.6.3", "wawoff2": "^2.0.1", - "@iosevka/util": "30.3.3" + "@iosevka/util": "30.4.0" } }