@ot-builder/cli-proc 1.5.5 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +58 -1
- package/CHANGELOG.md +17 -2
- package/lib/procs/gc.js +49 -0
- package/lib/procs/merge-consolidate/index.d.ts +2 -0
- package/lib/procs/merge-consolidate/index.js +2 -1
- package/package.json +8 -8
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,64 @@
|
|
|
2
2
|
"name": "@ot-builder/cli-proc",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Sat,
|
|
5
|
+
"date": "Sat, 21 Jan 2023 01:08:43 GMT",
|
|
6
|
+
"tag": "@ot-builder/cli-proc_v1.6.0",
|
|
7
|
+
"version": "1.6.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "otbbuilder-dev@users.noreply.github.com",
|
|
12
|
+
"package": "@ot-builder/cli-proc",
|
|
13
|
+
"commit": "e80cd99ac2e97a339ecbe083e3c9a2c10a6b12d7",
|
|
14
|
+
"comment": "GC: add functionality to cleanup inaccessible lookups"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@ot-builder/cli-proc",
|
|
19
|
+
"comment": "Bump @ot-builder/io-bin-font to v1.6.0",
|
|
20
|
+
"commit": "e80cd99ac2e97a339ecbe083e3c9a2c10a6b12d7"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@ot-builder/cli-proc",
|
|
25
|
+
"comment": "Bump @ot-builder/primitive to v1.6.0",
|
|
26
|
+
"commit": "e80cd99ac2e97a339ecbe083e3c9a2c10a6b12d7"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@ot-builder/cli-proc",
|
|
31
|
+
"comment": "Bump @ot-builder/common-impl to v1.6.0",
|
|
32
|
+
"commit": "e80cd99ac2e97a339ecbe083e3c9a2c10a6b12d7"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@ot-builder/cli-proc",
|
|
37
|
+
"comment": "Bump @ot-builder/rectify to v1.6.0",
|
|
38
|
+
"commit": "e80cd99ac2e97a339ecbe083e3c9a2c10a6b12d7"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"author": "beachball",
|
|
42
|
+
"package": "@ot-builder/cli-proc",
|
|
43
|
+
"comment": "Bump @ot-builder/trace to v1.6.0",
|
|
44
|
+
"commit": "e80cd99ac2e97a339ecbe083e3c9a2c10a6b12d7"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"author": "beachball",
|
|
48
|
+
"package": "@ot-builder/cli-proc",
|
|
49
|
+
"comment": "Bump @ot-builder/prelude to v1.6.0",
|
|
50
|
+
"commit": "e80cd99ac2e97a339ecbe083e3c9a2c10a6b12d7"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"author": "beachball",
|
|
54
|
+
"package": "@ot-builder/cli-proc",
|
|
55
|
+
"comment": "Bump @ot-builder/ot to v1.6.0",
|
|
56
|
+
"commit": "e80cd99ac2e97a339ecbe083e3c9a2c10a6b12d7"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"date": "Sat, 03 Dec 2022 01:09:39 GMT",
|
|
6
63
|
"tag": "@ot-builder/cli-proc_v1.5.5",
|
|
7
64
|
"version": "1.5.5",
|
|
8
65
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
# Change Log - @ot-builder/cli-proc
|
|
2
2
|
|
|
3
|
-
This log was last generated on Sat,
|
|
3
|
+
This log was last generated on Sat, 21 Jan 2023 01:08:43 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.6.0
|
|
8
|
+
|
|
9
|
+
Sat, 21 Jan 2023 01:08:43 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- GC: add functionality to cleanup inaccessible lookups (otbbuilder-dev@users.noreply.github.com)
|
|
14
|
+
- Bump @ot-builder/io-bin-font to v1.6.0
|
|
15
|
+
- Bump @ot-builder/primitive to v1.6.0
|
|
16
|
+
- Bump @ot-builder/common-impl to v1.6.0
|
|
17
|
+
- Bump @ot-builder/rectify to v1.6.0
|
|
18
|
+
- Bump @ot-builder/trace to v1.6.0
|
|
19
|
+
- Bump @ot-builder/prelude to v1.6.0
|
|
20
|
+
- Bump @ot-builder/ot to v1.6.0
|
|
21
|
+
|
|
7
22
|
## 1.5.5
|
|
8
23
|
|
|
9
|
-
Sat, 03 Dec 2022 01:
|
|
24
|
+
Sat, 03 Dec 2022 01:09:39 GMT
|
|
10
25
|
|
|
11
26
|
### Patches
|
|
12
27
|
|
package/lib/procs/gc.js
CHANGED
|
@@ -1,12 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.gcFont = void 0;
|
|
4
|
+
const ImpLib = require("@ot-builder/common-impl");
|
|
4
5
|
const Rectify = require("@ot-builder/rectify");
|
|
5
6
|
const initial_visible_glyphs_1 = require("../support/initial-visible-glyphs");
|
|
7
|
+
const index_1 = require("./merge-consolidate/index");
|
|
6
8
|
function gcFont(font, gsf) {
|
|
9
|
+
if (font.gsub)
|
|
10
|
+
cleanupInaccessibleLookups(font.gsub);
|
|
11
|
+
if (font.gpos)
|
|
12
|
+
cleanupInaccessibleLookups(font.gpos);
|
|
7
13
|
const { glyphs, rectifier } = (0, initial_visible_glyphs_1.createSubsetRectifier)(font, { has: () => true });
|
|
8
14
|
font.glyphs = gsf.createStoreFromList(glyphs);
|
|
9
15
|
Rectify.inPlaceRectifyFontGlyphReferences(rectifier, font);
|
|
16
|
+
if (font.gpos)
|
|
17
|
+
font.gpos = (0, index_1.consolidateGsubGpos)(font.fvar, font.gpos);
|
|
18
|
+
if (font.gsub)
|
|
19
|
+
font.gsub = (0, index_1.consolidateGsubGpos)(font.fvar, font.gsub);
|
|
10
20
|
}
|
|
11
21
|
exports.gcFont = gcFont;
|
|
22
|
+
function cleanupInaccessibleLookups(table) {
|
|
23
|
+
const keptFeatures = new Set();
|
|
24
|
+
for (const script of table.scripts.values()) {
|
|
25
|
+
if (script.defaultLanguage)
|
|
26
|
+
collectAccessibleFeatures(script.defaultLanguage, keptFeatures);
|
|
27
|
+
for (const lang of script.languages.values())
|
|
28
|
+
collectAccessibleFeatures(lang, keptFeatures);
|
|
29
|
+
}
|
|
30
|
+
const keptLookups = new Set();
|
|
31
|
+
for (const feature of table.features) {
|
|
32
|
+
if (!keptFeatures.has(feature))
|
|
33
|
+
emptyFeature(feature);
|
|
34
|
+
else
|
|
35
|
+
for (const lookup of feature.lookups)
|
|
36
|
+
keptLookups.add(lookup);
|
|
37
|
+
}
|
|
38
|
+
if (table.featureVariations) {
|
|
39
|
+
for (const fv of table.featureVariations) {
|
|
40
|
+
for (const [from, to] of fv.substitutions) {
|
|
41
|
+
if (!keptFeatures.has(from))
|
|
42
|
+
emptyFeature(to);
|
|
43
|
+
else
|
|
44
|
+
for (const lookup of to.lookups)
|
|
45
|
+
keptLookups.add(lookup);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
ImpLib.ArrayHelper.inPlaceShrinkArray(keptLookups, table.lookups);
|
|
50
|
+
}
|
|
51
|
+
function collectAccessibleFeatures(lang, sink) {
|
|
52
|
+
if (lang.requiredFeature)
|
|
53
|
+
sink.add(lang.requiredFeature);
|
|
54
|
+
for (const feature of lang.features)
|
|
55
|
+
sink.add(feature);
|
|
56
|
+
}
|
|
57
|
+
function emptyFeature(f) {
|
|
58
|
+
f.lookups = [];
|
|
59
|
+
f.params = null;
|
|
60
|
+
}
|
|
12
61
|
//# sourceMappingURL=gc.js.map
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as Ot from "@ot-builder/ot";
|
|
2
|
+
import { Data } from "@ot-builder/prelude";
|
|
2
3
|
export type MergeOptions = {
|
|
3
4
|
preferOverride?: boolean;
|
|
4
5
|
};
|
|
5
6
|
export declare function mergeFonts<GS extends Ot.GlyphStore, GS2 extends Ot.GlyphStore>(basis: Ot.Font<GS>, override: Ot.Font<GS2>, gsf: Ot.GlyphStoreFactory<GS>, opt?: MergeOptions): void;
|
|
6
7
|
export declare function consolidateFont<GS extends Ot.GlyphStore>(font: Ot.Font<GS>): void;
|
|
8
|
+
export declare function consolidateGsubGpos<L>(fvar: Data.Maybe<Ot.Fvar.Table>, preferred: Ot.GsubGpos.TableT<L>): Ot.GsubGpos.TableT<L>;
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.consolidateFont = exports.mergeFonts = void 0;
|
|
3
|
+
exports.consolidateGsubGpos = exports.consolidateFont = exports.mergeFonts = void 0;
|
|
4
4
|
const ImpLib = require("@ot-builder/common-impl");
|
|
5
5
|
const Ot = require("@ot-builder/ot");
|
|
6
6
|
const Rectify = require("@ot-builder/rectify");
|
|
@@ -83,4 +83,5 @@ function consolidateGsubGpos(fvar, preferred) {
|
|
|
83
83
|
const merger = new gsub_gpos_merger_1.GsubGposMerger(ImpLib.Order.fromList("Dimensions", fvar ? fvar.axes.map(a => a.dim) : []), preferred, { scripts: new Map(), features: [], lookups: [], featureVariations: [] });
|
|
84
84
|
return merger.resolve();
|
|
85
85
|
}
|
|
86
|
+
exports.consolidateGsubGpos = consolidateGsubGpos;
|
|
86
87
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ot-builder/cli-proc",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"tslib": "^2.0.0",
|
|
27
|
-
"@ot-builder/io-bin-font": "1.
|
|
28
|
-
"@ot-builder/primitive": "1.
|
|
29
|
-
"@ot-builder/common-impl": "1.
|
|
30
|
-
"@ot-builder/rectify": "1.
|
|
31
|
-
"@ot-builder/trace": "1.
|
|
32
|
-
"@ot-builder/prelude": "1.
|
|
33
|
-
"@ot-builder/ot": "1.
|
|
27
|
+
"@ot-builder/io-bin-font": "1.6.0",
|
|
28
|
+
"@ot-builder/primitive": "1.6.0",
|
|
29
|
+
"@ot-builder/common-impl": "1.6.0",
|
|
30
|
+
"@ot-builder/rectify": "1.6.0",
|
|
31
|
+
"@ot-builder/trace": "1.6.0",
|
|
32
|
+
"@ot-builder/prelude": "1.6.0",
|
|
33
|
+
"@ot-builder/ot": "1.6.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/jest": "^26.0.23",
|