@ot-builder/cli-proc 1.6.2 → 1.6.3
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/merge-consolidate/gsub-gpos-merger.d.ts +5 -2
- package/lib/procs/merge-consolidate/gsub-gpos-merger.js +55 -1
- package/lib/procs/merge-consolidate/index.d.ts +1 -1
- package/lib/procs/merge-consolidate/index.js +8 -8
- package/lib/procs/merge-consolidate/utils.d.ts +2 -0
- package/lib/procs/merge-consolidate/utils.js +22 -2
- 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, 22 Apr 2023 00:59:44 GMT",
|
|
6
|
+
"tag": "@ot-builder/cli-proc_v1.6.3",
|
|
7
|
+
"version": "1.6.3",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "otbbuilder-dev@users.noreply.github.com",
|
|
12
|
+
"package": "@ot-builder/cli-proc",
|
|
13
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2",
|
|
14
|
+
"comment": "Fix handling of ignore glyph set when merging fonts"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@ot-builder/cli-proc",
|
|
19
|
+
"comment": "Bump @ot-builder/io-bin-font to v1.6.3",
|
|
20
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@ot-builder/cli-proc",
|
|
25
|
+
"comment": "Bump @ot-builder/primitive to v1.6.3",
|
|
26
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@ot-builder/cli-proc",
|
|
31
|
+
"comment": "Bump @ot-builder/common-impl to v1.6.3",
|
|
32
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@ot-builder/cli-proc",
|
|
37
|
+
"comment": "Bump @ot-builder/rectify to v1.6.3",
|
|
38
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"author": "beachball",
|
|
42
|
+
"package": "@ot-builder/cli-proc",
|
|
43
|
+
"comment": "Bump @ot-builder/trace to v1.6.3",
|
|
44
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"author": "beachball",
|
|
48
|
+
"package": "@ot-builder/cli-proc",
|
|
49
|
+
"comment": "Bump @ot-builder/prelude to v1.6.3",
|
|
50
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"author": "beachball",
|
|
54
|
+
"package": "@ot-builder/cli-proc",
|
|
55
|
+
"comment": "Bump @ot-builder/ot to v1.6.3",
|
|
56
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"date": "Sat, 15 Apr 2023 01:06:43 GMT",
|
|
6
63
|
"tag": "@ot-builder/cli-proc_v1.6.2",
|
|
7
64
|
"version": "1.6.2",
|
|
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, 22 Apr 2023 00:59:44 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.6.3
|
|
8
|
+
|
|
9
|
+
Sat, 22 Apr 2023 00:59:44 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- Fix handling of ignore glyph set when merging fonts (otbbuilder-dev@users.noreply.github.com)
|
|
14
|
+
- Bump @ot-builder/io-bin-font to v1.6.3
|
|
15
|
+
- Bump @ot-builder/primitive to v1.6.3
|
|
16
|
+
- Bump @ot-builder/common-impl to v1.6.3
|
|
17
|
+
- Bump @ot-builder/rectify to v1.6.3
|
|
18
|
+
- Bump @ot-builder/trace to v1.6.3
|
|
19
|
+
- Bump @ot-builder/prelude to v1.6.3
|
|
20
|
+
- Bump @ot-builder/ot to v1.6.3
|
|
21
|
+
|
|
7
22
|
## 1.6.2
|
|
8
23
|
|
|
9
|
-
Sat, 15 Apr 2023 01:
|
|
24
|
+
Sat, 15 Apr 2023 01:06:43 GMT
|
|
10
25
|
|
|
11
26
|
### Patches
|
|
12
27
|
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import * as Ot from "@ot-builder/ot";
|
|
2
2
|
import { Data } from "@ot-builder/prelude";
|
|
3
3
|
import { FeatureConsolidationSource } from "./consolidate/feature";
|
|
4
|
-
export declare class GsubGposMerger<L> implements FeatureConsolidationSource<L> {
|
|
4
|
+
export declare class GsubGposMerger<L extends Ot.GsubGpos.LookupProp> implements FeatureConsolidationSource<L> {
|
|
5
5
|
readonly variationDimensions: Data.Order<Ot.Var.Dim>;
|
|
6
6
|
readonly preferred: Ot.GsubGpos.TableT<L>;
|
|
7
7
|
readonly less: Ot.GsubGpos.TableT<L>;
|
|
8
|
-
|
|
8
|
+
private readonly preferredGdef;
|
|
9
|
+
private readonly lessGdef;
|
|
10
|
+
constructor(variationDimensions: Data.Order<Ot.Var.Dim>, preferred: Ot.GsubGpos.TableT<L>, less: Ot.GsubGpos.TableT<L>, preferredGdef: Data.Maybe<Ot.Gdef.Table>, lessGdef: Data.Maybe<Ot.Gdef.Table>);
|
|
9
11
|
resolve(): Ot.GsubGpos.TableT<L>;
|
|
10
12
|
private getLookups;
|
|
13
|
+
private amendIgnoreSet;
|
|
11
14
|
private mergeScriptList;
|
|
12
15
|
private mergeScript;
|
|
13
16
|
private mergeLanguage;
|
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GsubGposMerger = void 0;
|
|
4
4
|
const ImpLib = require("@ot-builder/common-impl");
|
|
5
|
+
const Ot = require("@ot-builder/ot");
|
|
5
6
|
const feature_1 = require("./consolidate/feature");
|
|
6
7
|
const utils_1 = require("./utils");
|
|
7
8
|
class GsubGposMerger {
|
|
8
|
-
constructor(variationDimensions, preferred, less) {
|
|
9
|
+
constructor(variationDimensions, preferred, less, preferredGdef, lessGdef) {
|
|
9
10
|
this.variationDimensions = variationDimensions;
|
|
10
11
|
this.preferred = preferred;
|
|
11
12
|
this.less = less;
|
|
13
|
+
this.preferredGdef = preferredGdef;
|
|
14
|
+
this.lessGdef = lessGdef;
|
|
12
15
|
this.featureMergingPlans = new Map();
|
|
13
16
|
this.featureVariationCollection = new Map();
|
|
14
17
|
this.fordPreferred = ImpLib.Order.fromList("Features", preferred.features);
|
|
@@ -24,8 +27,59 @@ class GsubGposMerger {
|
|
|
24
27
|
return { scripts, features, lookups, featureVariations };
|
|
25
28
|
}
|
|
26
29
|
getLookups() {
|
|
30
|
+
const result = [];
|
|
31
|
+
for (const lookup of this.preferred.lookups) {
|
|
32
|
+
result.push(lookup);
|
|
33
|
+
if (this.preferredGdef && this.lessGdef) {
|
|
34
|
+
this.amendIgnoreSet(lookup, this.preferredGdef, this.lessGdef);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
for (const lookup of this.less.lookups) {
|
|
38
|
+
result.push(lookup);
|
|
39
|
+
if (this.preferredGdef && this.lessGdef) {
|
|
40
|
+
this.amendIgnoreSet(lookup, this.lessGdef, this.preferredGdef);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
27
43
|
return [...this.preferred.lookups, ...this.less.lookups];
|
|
28
44
|
}
|
|
45
|
+
amendIgnoreSet(lookup, currentGdef, counterGdef) {
|
|
46
|
+
if (!lookup.ignoreGlyphs)
|
|
47
|
+
return;
|
|
48
|
+
if (!currentGdef.glyphClassDef || !counterGdef.glyphClassDef)
|
|
49
|
+
return;
|
|
50
|
+
let hasBase = false, hasLigature = false, hasMark = false;
|
|
51
|
+
for (const [g, c] of currentGdef.glyphClassDef) {
|
|
52
|
+
if (!lookup.ignoreGlyphs.has(g))
|
|
53
|
+
continue;
|
|
54
|
+
switch (c) {
|
|
55
|
+
case Ot.Gdef.GlyphClass.Base:
|
|
56
|
+
hasBase = true;
|
|
57
|
+
break;
|
|
58
|
+
case Ot.Gdef.GlyphClass.Ligature:
|
|
59
|
+
hasLigature = true;
|
|
60
|
+
break;
|
|
61
|
+
case Ot.Gdef.GlyphClass.Mark:
|
|
62
|
+
hasMark = true;
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
for (const [g, c] of counterGdef.glyphClassDef) {
|
|
67
|
+
switch (c) {
|
|
68
|
+
case Ot.Gdef.GlyphClass.Base:
|
|
69
|
+
if (hasBase)
|
|
70
|
+
lookup.ignoreGlyphs.add(g);
|
|
71
|
+
break;
|
|
72
|
+
case Ot.Gdef.GlyphClass.Ligature:
|
|
73
|
+
if (hasLigature)
|
|
74
|
+
lookup.ignoreGlyphs.add(g);
|
|
75
|
+
break;
|
|
76
|
+
case Ot.Gdef.GlyphClass.Mark:
|
|
77
|
+
if (hasMark)
|
|
78
|
+
lookup.ignoreGlyphs.add(g);
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
29
83
|
mergeScriptList() {
|
|
30
84
|
return (0, utils_1.mergeMapAlt)(this.preferred.scripts, this.less.scripts, this.mergeScript.bind(this));
|
|
31
85
|
}
|
|
@@ -5,5 +5,5 @@ export type MergeOptions = {
|
|
|
5
5
|
};
|
|
6
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;
|
|
7
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>;
|
|
8
|
+
export declare function consolidateGsubGpos<L extends Ot.GsubGpos.LookupProp>(fvar: Data.Maybe<Ot.Fvar.Table>, preferred: Ot.GsubGpos.TableT<L>): Ot.GsubGpos.TableT<L>;
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -32,14 +32,14 @@ exports.consolidateFont = consolidateFont;
|
|
|
32
32
|
function mergeFontTables(basis, override, opt) {
|
|
33
33
|
if (opt.preferOverride) {
|
|
34
34
|
basis.cmap = mergeCmap(override.cmap, basis.cmap);
|
|
35
|
-
basis.gsub = mergeGsubGpos(override.fvar, override.gsub, basis.gsub);
|
|
36
|
-
basis.gpos = mergeGsubGpos(override.fvar, override.gpos, basis.gpos);
|
|
35
|
+
basis.gsub = mergeGsubGpos(override.fvar, override.gsub, basis.gsub, override.gdef, basis.gdef);
|
|
36
|
+
basis.gpos = mergeGsubGpos(override.fvar, override.gpos, basis.gpos, override.gdef, basis.gdef);
|
|
37
37
|
basis.gdef = mergeGdef(override.gdef, basis.gdef);
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
40
40
|
basis.cmap = mergeCmap(basis.cmap, override.cmap);
|
|
41
|
-
basis.gsub = mergeGsubGpos(basis.fvar, basis.gsub, override.gsub);
|
|
42
|
-
basis.gpos = mergeGsubGpos(basis.fvar, basis.gpos, override.gpos);
|
|
41
|
+
basis.gsub = mergeGsubGpos(basis.fvar, basis.gsub, override.gsub, basis.gdef, override.gdef);
|
|
42
|
+
basis.gpos = mergeGsubGpos(basis.fvar, basis.gpos, override.gpos, basis.gdef, override.gdef);
|
|
43
43
|
basis.gdef = mergeGdef(basis.gdef, override.gdef);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -67,20 +67,20 @@ function mergeGdef(preferred, less) {
|
|
|
67
67
|
result.glyphClassDef = (0, utils_1.mergeMapOpt)(preferred.glyphClassDef, less.glyphClassDef, utils_1.Prime);
|
|
68
68
|
result.attachList = (0, utils_1.mergeMapOpt)(preferred.attachList, less.attachList, utils_1.Prime);
|
|
69
69
|
result.ligCarets = (0, utils_1.mergeMapOpt)(preferred.ligCarets, less.ligCarets, utils_1.Prime);
|
|
70
|
-
result.markAttachClassDef = (0, utils_1.
|
|
70
|
+
result.markAttachClassDef = (0, utils_1.mergeClassDefOpt)(preferred.markAttachClassDef, less.markAttachClassDef);
|
|
71
71
|
result.markGlyphSets = (0, utils_1.combineList)(preferred.markGlyphSets, less.markGlyphSets);
|
|
72
72
|
return result;
|
|
73
73
|
}
|
|
74
|
-
function mergeGsubGpos(fvar, preferred, less) {
|
|
74
|
+
function mergeGsubGpos(fvar, preferred, less, preferredGdef, lessGdef) {
|
|
75
75
|
if (!preferred)
|
|
76
76
|
return less;
|
|
77
77
|
if (!less)
|
|
78
78
|
return preferred;
|
|
79
|
-
const merger = new gsub_gpos_merger_1.GsubGposMerger(ImpLib.Order.fromList("Dimensions", fvar ? fvar.axes.map(a => a.dim) : []), preferred, less);
|
|
79
|
+
const merger = new gsub_gpos_merger_1.GsubGposMerger(ImpLib.Order.fromList("Dimensions", fvar ? fvar.axes.map(a => a.dim) : []), preferred, less, preferredGdef, lessGdef);
|
|
80
80
|
return merger.resolve();
|
|
81
81
|
}
|
|
82
82
|
function consolidateGsubGpos(fvar, preferred) {
|
|
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: [] });
|
|
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: [] }, null, null);
|
|
84
84
|
return merger.resolve();
|
|
85
85
|
}
|
|
86
86
|
exports.consolidateGsubGpos = consolidateGsubGpos;
|
|
@@ -2,6 +2,8 @@ import { Data } from "@ot-builder/prelude";
|
|
|
2
2
|
export declare function combineList<T>(a: Data.Maybe<ReadonlyArray<T>>, b: Data.Maybe<ReadonlyArray<T>>): T[];
|
|
3
3
|
export declare function mergeMapOpt<K, V>(preferred: Data.Maybe<Map<K, V>>, less: Data.Maybe<Map<K, V>>, mergeValue: (a: V, b: V) => V): Data.Maybe<Map<K, V>>;
|
|
4
4
|
export declare function mergeMap<K, V>(preferred: Map<K, V>, less: Map<K, V>, mergeValue: (a: V, b: V) => V): Map<K, V>;
|
|
5
|
+
export declare function mergeClassDefOpt<K>(preferred: Data.Maybe<Map<K, number>>, less: Data.Maybe<Map<K, number>>): Data.Maybe<Map<K, number>>;
|
|
6
|
+
export declare function mergeClassDef<K>(preferred: Map<K, number>, less: Map<K, number>): Map<K, number>;
|
|
5
7
|
export declare function mergeMapAlt<K, V>(preferred: Map<K, V>, less: Map<K, V>, mergeValue: (a: undefined | V, b: undefined | V) => V): Map<K, V>;
|
|
6
8
|
export declare function Prime<K>(a: K, b: K): K;
|
|
7
9
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Prime = exports.mergeMapAlt = exports.mergeMap = exports.mergeMapOpt = exports.combineList = void 0;
|
|
3
|
+
exports.Prime = exports.mergeMapAlt = exports.mergeClassDef = exports.mergeClassDefOpt = exports.mergeMap = exports.mergeMapOpt = exports.combineList = void 0;
|
|
4
4
|
function combineList(a, b) {
|
|
5
|
-
return [...(a || []), ...(
|
|
5
|
+
return [...(a || []), ...(b || [])];
|
|
6
6
|
}
|
|
7
7
|
exports.combineList = combineList;
|
|
8
8
|
function mergeMapOpt(preferred, less, mergeValue) {
|
|
@@ -26,6 +26,26 @@ function mergeMap(preferred, less, mergeValue) {
|
|
|
26
26
|
return m;
|
|
27
27
|
}
|
|
28
28
|
exports.mergeMap = mergeMap;
|
|
29
|
+
function mergeClassDefOpt(preferred, less) {
|
|
30
|
+
if (!preferred)
|
|
31
|
+
return less;
|
|
32
|
+
if (!less)
|
|
33
|
+
return preferred;
|
|
34
|
+
return mergeClassDef(preferred, less);
|
|
35
|
+
}
|
|
36
|
+
exports.mergeClassDefOpt = mergeClassDefOpt;
|
|
37
|
+
function mergeClassDef(preferred, less) {
|
|
38
|
+
const m = new Map(preferred);
|
|
39
|
+
let maxClass = 0;
|
|
40
|
+
for (const v of m.values())
|
|
41
|
+
if (v > maxClass)
|
|
42
|
+
maxClass = v;
|
|
43
|
+
for (const [k, v] of less)
|
|
44
|
+
if (!m.has(k))
|
|
45
|
+
m.set(k, v + maxClass);
|
|
46
|
+
return m;
|
|
47
|
+
}
|
|
48
|
+
exports.mergeClassDef = mergeClassDef;
|
|
29
49
|
function mergeMapAlt(preferred, less, mergeValue) {
|
|
30
50
|
const keySet = new Set([...preferred.keys(), ...less.keys()]);
|
|
31
51
|
const m = new Map();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ot-builder/cli-proc",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3",
|
|
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.6.
|
|
28
|
-
"@ot-builder/primitive": "1.6.
|
|
29
|
-
"@ot-builder/common-impl": "1.6.
|
|
30
|
-
"@ot-builder/rectify": "1.6.
|
|
31
|
-
"@ot-builder/trace": "1.6.
|
|
32
|
-
"@ot-builder/prelude": "1.6.
|
|
33
|
-
"@ot-builder/ot": "1.6.
|
|
27
|
+
"@ot-builder/io-bin-font": "1.6.3",
|
|
28
|
+
"@ot-builder/primitive": "1.6.3",
|
|
29
|
+
"@ot-builder/common-impl": "1.6.3",
|
|
30
|
+
"@ot-builder/rectify": "1.6.3",
|
|
31
|
+
"@ot-builder/trace": "1.6.3",
|
|
32
|
+
"@ot-builder/prelude": "1.6.3",
|
|
33
|
+
"@ot-builder/ot": "1.6.3"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/jest": "^26.0.23",
|