@ot-builder/io-bin-layout 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 +136 -1
- package/CHANGELOG.md +30 -2
- package/lib/gsub-gpos-shared/decide-ignore-flags.d.ts +4 -4
- package/lib/gsub-gpos-shared/decide-ignore-flags.js +75 -96
- package/lib/gsub-gpos-shared/read-lookup-list.js +16 -7
- package/lib/gsub-gpos-shared/write-lookup-list.js +2 -2
- package/lib/lookups/gpos-mark-write.d.ts +1 -0
- package/lib/lookups/gpos-mark-write.js +17 -3
- package/package.json +19 -19
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,142 @@
|
|
|
2
2
|
"name": "@ot-builder/io-bin-layout",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Sat,
|
|
5
|
+
"date": "Sat, 22 Apr 2023 00:59:44 GMT",
|
|
6
|
+
"tag": "@ot-builder/io-bin-layout_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/io-bin-layout",
|
|
13
|
+
"commit": "dc2c43855a1556176041326c5aac1cb4c8868b9e",
|
|
14
|
+
"comment": "Bugfix for a mark class that has no bases"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "otbbuilder-dev@users.noreply.github.com",
|
|
18
|
+
"package": "@ot-builder/io-bin-layout",
|
|
19
|
+
"commit": "df27eccdd84a210e939708f225c465911a0882cd",
|
|
20
|
+
"comment": "Fix handling of mark attachment flags in lookups"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "otbbuilder-dev@users.noreply.github.com",
|
|
24
|
+
"package": "@ot-builder/io-bin-layout",
|
|
25
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2",
|
|
26
|
+
"comment": "Fix handling of ignore glyph set when merging fonts"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@ot-builder/io-bin-layout",
|
|
31
|
+
"comment": "Bump @ot-builder/bin-composite-types to v1.6.3",
|
|
32
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@ot-builder/io-bin-layout",
|
|
37
|
+
"comment": "Bump @ot-builder/bin-util to v1.6.3",
|
|
38
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"author": "beachball",
|
|
42
|
+
"package": "@ot-builder/io-bin-layout",
|
|
43
|
+
"comment": "Bump @ot-builder/errors to v1.6.3",
|
|
44
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"author": "beachball",
|
|
48
|
+
"package": "@ot-builder/io-bin-layout",
|
|
49
|
+
"comment": "Bump @ot-builder/ot-glyphs to v1.6.3",
|
|
50
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"author": "beachball",
|
|
54
|
+
"package": "@ot-builder/io-bin-layout",
|
|
55
|
+
"comment": "Bump @ot-builder/ot-layout to v1.6.3",
|
|
56
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"author": "beachball",
|
|
60
|
+
"package": "@ot-builder/io-bin-layout",
|
|
61
|
+
"comment": "Bump @ot-builder/ot-metadata to v1.6.3",
|
|
62
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"author": "beachball",
|
|
66
|
+
"package": "@ot-builder/io-bin-layout",
|
|
67
|
+
"comment": "Bump @ot-builder/prelude to v1.6.3",
|
|
68
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"author": "beachball",
|
|
72
|
+
"package": "@ot-builder/io-bin-layout",
|
|
73
|
+
"comment": "Bump @ot-builder/primitive to v1.6.3",
|
|
74
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"author": "beachball",
|
|
78
|
+
"package": "@ot-builder/io-bin-layout",
|
|
79
|
+
"comment": "Bump @ot-builder/var-store to v1.6.3",
|
|
80
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"author": "beachball",
|
|
84
|
+
"package": "@ot-builder/io-bin-layout",
|
|
85
|
+
"comment": "Bump @ot-builder/variance to v1.6.3",
|
|
86
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"author": "beachball",
|
|
90
|
+
"package": "@ot-builder/io-bin-layout",
|
|
91
|
+
"comment": "Bump @ot-builder/common-impl to v1.6.3",
|
|
92
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"author": "beachball",
|
|
96
|
+
"package": "@ot-builder/io-bin-layout",
|
|
97
|
+
"comment": "Bump @ot-builder/ot-sfnt to v1.6.3",
|
|
98
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"author": "beachball",
|
|
102
|
+
"package": "@ot-builder/io-bin-layout",
|
|
103
|
+
"comment": "Bump @ot-builder/io-bin-sfnt to v1.6.3",
|
|
104
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"author": "beachball",
|
|
108
|
+
"package": "@ot-builder/io-bin-layout",
|
|
109
|
+
"comment": "Bump @ot-builder/io-bin-glyph-store to v1.6.3",
|
|
110
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"author": "beachball",
|
|
114
|
+
"package": "@ot-builder/io-bin-layout",
|
|
115
|
+
"comment": "Bump @ot-builder/io-bin-metadata to v1.6.3",
|
|
116
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"author": "beachball",
|
|
120
|
+
"package": "@ot-builder/io-bin-layout",
|
|
121
|
+
"comment": "Bump @ot-builder/ot-encoding to v1.6.3",
|
|
122
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"author": "beachball",
|
|
126
|
+
"package": "@ot-builder/io-bin-layout",
|
|
127
|
+
"comment": "Bump @ot-builder/io-bin-encoding to v1.6.3",
|
|
128
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"author": "beachball",
|
|
132
|
+
"package": "@ot-builder/io-bin-layout",
|
|
133
|
+
"comment": "Bump @ot-builder/test-util to v1.6.3",
|
|
134
|
+
"commit": "b19d6f897aa2a52a78cc95ca4832baeda71446a2"
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"date": "Sat, 15 Apr 2023 01:06:43 GMT",
|
|
6
141
|
"tag": "@ot-builder/io-bin-layout_v1.6.2",
|
|
7
142
|
"version": "1.6.2",
|
|
8
143
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,40 @@
|
|
|
1
1
|
# Change Log - @ot-builder/io-bin-layout
|
|
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
|
+
- Bugfix for a mark class that has no bases (otbbuilder-dev@users.noreply.github.com)
|
|
14
|
+
- Fix handling of mark attachment flags in lookups (otbbuilder-dev@users.noreply.github.com)
|
|
15
|
+
- Fix handling of ignore glyph set when merging fonts (otbbuilder-dev@users.noreply.github.com)
|
|
16
|
+
- Bump @ot-builder/bin-composite-types to v1.6.3
|
|
17
|
+
- Bump @ot-builder/bin-util to v1.6.3
|
|
18
|
+
- Bump @ot-builder/errors to v1.6.3
|
|
19
|
+
- Bump @ot-builder/ot-glyphs to v1.6.3
|
|
20
|
+
- Bump @ot-builder/ot-layout to v1.6.3
|
|
21
|
+
- Bump @ot-builder/ot-metadata to v1.6.3
|
|
22
|
+
- Bump @ot-builder/prelude to v1.6.3
|
|
23
|
+
- Bump @ot-builder/primitive to v1.6.3
|
|
24
|
+
- Bump @ot-builder/var-store to v1.6.3
|
|
25
|
+
- Bump @ot-builder/variance to v1.6.3
|
|
26
|
+
- Bump @ot-builder/common-impl to v1.6.3
|
|
27
|
+
- Bump @ot-builder/ot-sfnt to v1.6.3
|
|
28
|
+
- Bump @ot-builder/io-bin-sfnt to v1.6.3
|
|
29
|
+
- Bump @ot-builder/io-bin-glyph-store to v1.6.3
|
|
30
|
+
- Bump @ot-builder/io-bin-metadata to v1.6.3
|
|
31
|
+
- Bump @ot-builder/ot-encoding to v1.6.3
|
|
32
|
+
- Bump @ot-builder/io-bin-encoding to v1.6.3
|
|
33
|
+
- Bump @ot-builder/test-util to v1.6.3
|
|
34
|
+
|
|
7
35
|
## 1.6.2
|
|
8
36
|
|
|
9
|
-
Sat, 15 Apr 2023 01:
|
|
37
|
+
Sat, 15 Apr 2023 01:06:43 GMT
|
|
10
38
|
|
|
11
39
|
### Patches
|
|
12
40
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Gdef } from "@ot-builder/ot-layout";
|
|
2
2
|
import { Data } from "@ot-builder/prelude";
|
|
3
3
|
export interface IgnoreFlagOptions {
|
|
4
|
-
ignoreBaseGlyphs
|
|
5
|
-
ignoreLigatures
|
|
6
|
-
ignoreMarks
|
|
4
|
+
ignoreBaseGlyphs?: boolean;
|
|
5
|
+
ignoreLigatures?: boolean;
|
|
6
|
+
ignoreMarks?: boolean;
|
|
7
7
|
markAttachmentType?: number;
|
|
8
8
|
markFilteringSet?: number;
|
|
9
9
|
}
|
|
10
|
-
export declare function decideIgnoreFlags<G, X>(gs: Data.Maybe<ReadonlySet<G>>,
|
|
10
|
+
export declare function decideIgnoreFlags<G, X>(gs: Data.Maybe<ReadonlySet<G>>, gdef: Data.Maybe<Gdef.General.TableT<G, X>>): null | IgnoreFlagOptions;
|
|
11
11
|
//# sourceMappingURL=decide-ignore-flags.d.ts.map
|
|
@@ -2,121 +2,100 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.decideIgnoreFlags = void 0;
|
|
4
4
|
const ot_layout_1 = require("@ot-builder/ot-layout");
|
|
5
|
-
function decideIgnoreFlags(gs,
|
|
6
|
-
if (!
|
|
5
|
+
function decideIgnoreFlags(gs, gdef) {
|
|
6
|
+
if (!gdef || !gs || !gs.size)
|
|
7
7
|
return null;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const [nonMarks, marks] = gsSplitMarks(gs, gdef.glyphClassDef);
|
|
9
|
+
const igfBase = igfGlyphClass(nonMarks, gdef.glyphClassDef, ot_layout_1.Gdef.GlyphClass.Base, { ignoreBaseGlyphs: true }, { ignoreBaseGlyphs: false });
|
|
10
|
+
const igfLigature = igfGlyphClass(nonMarks, gdef.glyphClassDef, ot_layout_1.Gdef.GlyphClass.Ligature, { ignoreLigatures: true }, { ignoreLigatures: false });
|
|
11
|
+
const igfMark = igfGlyphClass(marks, gdef.glyphClassDef, ot_layout_1.Gdef.GlyphClass.Mark, { ignoreMarks: true }, { ignoreMarks: false }) ||
|
|
12
|
+
igfMarkAttachmentClass(marks, gdef.glyphClassDef, gdef.markAttachClassDef) ||
|
|
13
|
+
igfMarkFilterSet(marks, gdef.glyphClassDef, gdef.markGlyphSets);
|
|
14
|
+
return {
|
|
15
|
+
...igfBase,
|
|
16
|
+
...igfLigature,
|
|
17
|
+
...igfMark
|
|
18
|
+
};
|
|
12
19
|
}
|
|
13
20
|
exports.decideIgnoreFlags = decideIgnoreFlags;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
/// Split non-mark and mark glyphs
|
|
22
|
+
function gsSplitMarks(ignoredGlyphs, glyphClassDef) {
|
|
23
|
+
if (!glyphClassDef)
|
|
24
|
+
return [new Set(ignoredGlyphs), new Set()];
|
|
25
|
+
const marks = new Set(), nonMarks = new Set();
|
|
26
|
+
for (const g of ignoredGlyphs) {
|
|
27
|
+
if (ot_layout_1.Gdef.GlyphClass.Mark === glyphClassDef.get(g)) {
|
|
28
|
+
marks.add(g);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
nonMarks.add(g);
|
|
32
|
+
}
|
|
21
33
|
}
|
|
22
|
-
return
|
|
34
|
+
return [nonMarks, marks];
|
|
23
35
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
36
|
+
function igfGlyphClass(ignoredGlyphs, glyphClassDef, glyphClass, positive, negative) {
|
|
37
|
+
if (!glyphClassDef)
|
|
38
|
+
return null;
|
|
39
|
+
let has = false, all = true;
|
|
40
|
+
for (const [g, cl] of glyphClassDef) {
|
|
41
|
+
if (cl !== glyphClass)
|
|
42
|
+
continue;
|
|
43
|
+
if (ignoredGlyphs.has(g)) {
|
|
44
|
+
has = true;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
all = false;
|
|
48
|
+
}
|
|
28
49
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
this.has = true;
|
|
32
|
-
else
|
|
33
|
-
this.all = false;
|
|
50
|
+
if (!has) {
|
|
51
|
+
return negative;
|
|
34
52
|
}
|
|
35
|
-
|
|
36
|
-
return
|
|
53
|
+
else if (all) {
|
|
54
|
+
return positive;
|
|
37
55
|
}
|
|
38
|
-
|
|
39
|
-
function igfGlyphClass(gs, cd) {
|
|
40
|
-
if (!gs || !gs.size || !cd)
|
|
56
|
+
else {
|
|
41
57
|
return null;
|
|
42
|
-
const base = new HasAllState(), ligature = new HasAllState(), mark = new HasAllState();
|
|
43
|
-
const cov = new Set();
|
|
44
|
-
for (const [g, cl] of cd) {
|
|
45
|
-
const inSet = gs.has(g);
|
|
46
|
-
switch (cl) {
|
|
47
|
-
case ot_layout_1.Gdef.GlyphClass.Base:
|
|
48
|
-
base.update(inSet);
|
|
49
|
-
cov.add(g);
|
|
50
|
-
break;
|
|
51
|
-
case ot_layout_1.Gdef.GlyphClass.Ligature:
|
|
52
|
-
ligature.update(inSet);
|
|
53
|
-
cov.add(g);
|
|
54
|
-
break;
|
|
55
|
-
case ot_layout_1.Gdef.GlyphClass.Mark:
|
|
56
|
-
mark.update(inSet);
|
|
57
|
-
cov.add(g);
|
|
58
|
-
}
|
|
59
58
|
}
|
|
60
|
-
if (base.mix || ligature.mix || mark.mix)
|
|
61
|
-
return null;
|
|
62
|
-
for (const g of gs)
|
|
63
|
-
if (!cov.has(g))
|
|
64
|
-
return null;
|
|
65
|
-
return {
|
|
66
|
-
ignoreBaseGlyphs: base.has,
|
|
67
|
-
ignoreLigatures: ligature.has,
|
|
68
|
-
ignoreMarks: mark.has
|
|
69
|
-
};
|
|
70
59
|
}
|
|
71
|
-
function
|
|
72
|
-
if (!
|
|
60
|
+
function igfMarkAttachmentClass(ignoredMarks, glyphClassDef, markAttachmentClassDef) {
|
|
61
|
+
if (!glyphClassDef || !markAttachmentClassDef)
|
|
73
62
|
return null;
|
|
74
|
-
//
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (
|
|
63
|
+
// We need to iterate through all the marks, since in some cases we are ignoring mark class "0"
|
|
64
|
+
const keptMarkClasses = new Set();
|
|
65
|
+
const ignoredMarkClasses = new Set();
|
|
66
|
+
for (const [g, gc] of glyphClassDef) {
|
|
67
|
+
if (gc !== ot_layout_1.Gdef.GlyphClass.Mark)
|
|
68
|
+
continue;
|
|
69
|
+
const k = markAttachmentClassDef.get(g) || 0;
|
|
70
|
+
(ignoredMarks.has(g) ? ignoredMarkClasses : keptMarkClasses).add(k);
|
|
71
|
+
}
|
|
72
|
+
let finalMarkClass = undefined;
|
|
73
|
+
for (const k of keptMarkClasses) {
|
|
74
|
+
// Hybrid class, fail
|
|
75
|
+
if (ignoredMarkClasses.has(k))
|
|
79
76
|
return null;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
else if (kg !== kMark)
|
|
77
|
+
// Multiple mark classes to keep, fail
|
|
78
|
+
if (finalMarkClass != undefined)
|
|
83
79
|
return null;
|
|
80
|
+
finalMarkClass = k;
|
|
84
81
|
}
|
|
85
|
-
//
|
|
86
|
-
if (
|
|
82
|
+
// Nothing to keep, fail
|
|
83
|
+
if (!finalMarkClass || finalMarkClass <= 0 || finalMarkClass > 0xff)
|
|
87
84
|
return null;
|
|
88
|
-
|
|
89
|
-
if (cl === kMark && !gs.has(g))
|
|
90
|
-
return null;
|
|
91
|
-
}
|
|
92
|
-
return {
|
|
93
|
-
ignoreBaseGlyphs: false,
|
|
94
|
-
ignoreLigatures: false,
|
|
95
|
-
ignoreMarks: false,
|
|
96
|
-
markAttachmentType: kMark
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
function setEqual(a, b) {
|
|
100
|
-
for (const g of a)
|
|
101
|
-
if (!b.has(g))
|
|
102
|
-
return false;
|
|
103
|
-
for (const g of b)
|
|
104
|
-
if (!a.has(g))
|
|
105
|
-
return false;
|
|
106
|
-
return true;
|
|
85
|
+
return { markAttachmentType: finalMarkClass };
|
|
107
86
|
}
|
|
108
|
-
function
|
|
109
|
-
if (!
|
|
87
|
+
function igfMarkFilterSet(ignoredMarks, glyphClassDef, markGlyphSets) {
|
|
88
|
+
if (!glyphClassDef || !markGlyphSets)
|
|
110
89
|
return null;
|
|
111
|
-
for (let mgsIndex = 0; mgsIndex <
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
};
|
|
90
|
+
out: for (let mgsIndex = 0; mgsIndex < markGlyphSets.length; mgsIndex++) {
|
|
91
|
+
const mgs = markGlyphSets[mgsIndex];
|
|
92
|
+
for (const [g, gc] of glyphClassDef) {
|
|
93
|
+
if (gc !== ot_layout_1.Gdef.GlyphClass.Mark)
|
|
94
|
+
continue;
|
|
95
|
+
if (ignoredMarks.has(g) !== !mgs.has(g))
|
|
96
|
+
continue out;
|
|
119
97
|
}
|
|
98
|
+
return { markFilteringSet: mgsIndex };
|
|
120
99
|
}
|
|
121
100
|
return null;
|
|
122
101
|
}
|
|
@@ -39,23 +39,32 @@ class CReadLookupList {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
applyGdefMarkAttachDefIgnores(ignores, flags, gdef) {
|
|
42
|
-
if (gdef.
|
|
42
|
+
if (gdef.glyphClassDef &&
|
|
43
|
+
gdef.markAttachClassDef &&
|
|
44
|
+
flags & general_1.LookupFlag.MarkAttachmentType) {
|
|
43
45
|
const maCls = (flags & general_1.LookupFlag.MarkAttachmentType) >>> 8;
|
|
44
|
-
for (const [g, cls] of gdef.
|
|
45
|
-
if (cls
|
|
46
|
+
for (const [g, cls] of gdef.glyphClassDef) {
|
|
47
|
+
if (cls !== ot_layout_1.Gdef.GlyphClass.Mark)
|
|
48
|
+
continue;
|
|
49
|
+
const k = gdef.markAttachClassDef.get(g) || 0;
|
|
50
|
+
if (k !== maCls)
|
|
46
51
|
ignores.add(g);
|
|
47
52
|
}
|
|
48
53
|
}
|
|
49
54
|
}
|
|
50
55
|
applyGdefMarkGlyphSetIgnores(ignores, flags, markFilteringSet, gdef) {
|
|
51
|
-
if (gdef.
|
|
56
|
+
if (gdef.glyphClassDef &&
|
|
57
|
+
gdef.markGlyphSets &&
|
|
52
58
|
flags & general_1.LookupFlag.UseMarkFilteringSet &&
|
|
53
59
|
markFilteringSet != null) {
|
|
54
60
|
const mgs = gdef.markGlyphSets[markFilteringSet];
|
|
55
|
-
if (mgs)
|
|
56
|
-
|
|
61
|
+
if (!mgs)
|
|
62
|
+
return;
|
|
63
|
+
for (const [g, cls] of gdef.glyphClassDef) {
|
|
64
|
+
if (cls !== ot_layout_1.Gdef.GlyphClass.Mark)
|
|
65
|
+
continue;
|
|
66
|
+
if (!mgs.has(g))
|
|
57
67
|
ignores.add(g);
|
|
58
|
-
}
|
|
59
68
|
}
|
|
60
69
|
}
|
|
61
70
|
}
|
|
@@ -95,10 +95,10 @@ class LookupListWriter {
|
|
|
95
95
|
if (ignore) {
|
|
96
96
|
if (ignore.ignoreBaseGlyphs)
|
|
97
97
|
flags |= general_1.LookupFlag.IgnoreBaseGlyphs;
|
|
98
|
-
if (ignore.ignoreMarks)
|
|
99
|
-
flags |= general_1.LookupFlag.IgnoreMarks;
|
|
100
98
|
if (ignore.ignoreLigatures)
|
|
101
99
|
flags |= general_1.LookupFlag.IgnoreLigatures;
|
|
100
|
+
if (ignore.ignoreMarks)
|
|
101
|
+
flags |= general_1.LookupFlag.IgnoreMarks;
|
|
102
102
|
if (ignore.markAttachmentType != null) {
|
|
103
103
|
flags |= ignore.markAttachmentType << 8;
|
|
104
104
|
}
|
|
@@ -40,6 +40,7 @@ declare abstract class GposMarkWriterBase<G, B> {
|
|
|
40
40
|
private getInitialPlans;
|
|
41
41
|
private getMaxAnchorClass;
|
|
42
42
|
private fetchValidPlan;
|
|
43
|
+
private basesHasAtLeastOneBaseInThisClass;
|
|
43
44
|
}
|
|
44
45
|
export declare class GposMarkToBaseWriter extends GposMarkWriterBase<OtGlyph, Gpos.BaseRecord> implements LookupWriter<Gpos.Lookup, Gpos.MarkToBase> {
|
|
45
46
|
canBeUsed(l: Gpos.Lookup): l is Gpos.MarkToBase;
|
|
@@ -274,7 +274,13 @@ class GposMarkWriterBase {
|
|
|
274
274
|
loopCls: for (let c = 0; c < maxCls; c++) {
|
|
275
275
|
if (clsSetAdded.has(c))
|
|
276
276
|
continue;
|
|
277
|
-
|
|
277
|
+
// Detect that we have at least one base that contains this class
|
|
278
|
+
// If not, just treat this class processed and move on
|
|
279
|
+
if (!this.basesHasAtLeastOneBaseInThisClass(cls, c, bases)) {
|
|
280
|
+
clsSetAdded.add(c);
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
let fConflict = false;
|
|
278
284
|
const currentClassMarks = new Map();
|
|
279
285
|
// Process mark list: ensure this class doesn't conflict with existing marks
|
|
280
286
|
for (const [g, ma] of marks) {
|
|
@@ -283,9 +289,9 @@ class GposMarkWriterBase {
|
|
|
283
289
|
continue;
|
|
284
290
|
currentClassMarks.set(g, { glyph: g, class: c, anchor });
|
|
285
291
|
if (planMarks.has(g))
|
|
286
|
-
|
|
292
|
+
fConflict = true;
|
|
287
293
|
}
|
|
288
|
-
if (
|
|
294
|
+
if (fConflict)
|
|
289
295
|
break loopCls;
|
|
290
296
|
// Ensure the base array is a rectangular matrix
|
|
291
297
|
if (firstClass) {
|
|
@@ -313,6 +319,14 @@ class GposMarkWriterBase {
|
|
|
313
319
|
return null;
|
|
314
320
|
}
|
|
315
321
|
}
|
|
322
|
+
basesHasAtLeastOneBaseInThisClass(cls, c, bases) {
|
|
323
|
+
for (const [g, br] of bases) {
|
|
324
|
+
if (cls.baseCoversMarkClass(c, br)) {
|
|
325
|
+
return true;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
return false;
|
|
329
|
+
}
|
|
316
330
|
}
|
|
317
331
|
class GposMarkToBaseWriter extends GposMarkWriterBase {
|
|
318
332
|
canBeUsed(l) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ot-builder/io-bin-layout",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,27 +23,27 @@
|
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@ot-builder/bin-composite-types": "1.6.
|
|
27
|
-
"@ot-builder/bin-util": "1.6.
|
|
28
|
-
"@ot-builder/errors": "1.6.
|
|
29
|
-
"@ot-builder/ot-glyphs": "1.6.
|
|
30
|
-
"@ot-builder/ot-layout": "1.6.
|
|
31
|
-
"@ot-builder/ot-metadata": "1.6.
|
|
32
|
-
"@ot-builder/prelude": "1.6.
|
|
33
|
-
"@ot-builder/primitive": "1.6.
|
|
34
|
-
"@ot-builder/var-store": "1.6.
|
|
35
|
-
"@ot-builder/variance": "1.6.
|
|
36
|
-
"@ot-builder/common-impl": "1.6.
|
|
37
|
-
"@ot-builder/ot-sfnt": "1.6.
|
|
38
|
-
"@ot-builder/io-bin-sfnt": "1.6.
|
|
26
|
+
"@ot-builder/bin-composite-types": "1.6.3",
|
|
27
|
+
"@ot-builder/bin-util": "1.6.3",
|
|
28
|
+
"@ot-builder/errors": "1.6.3",
|
|
29
|
+
"@ot-builder/ot-glyphs": "1.6.3",
|
|
30
|
+
"@ot-builder/ot-layout": "1.6.3",
|
|
31
|
+
"@ot-builder/ot-metadata": "1.6.3",
|
|
32
|
+
"@ot-builder/prelude": "1.6.3",
|
|
33
|
+
"@ot-builder/primitive": "1.6.3",
|
|
34
|
+
"@ot-builder/var-store": "1.6.3",
|
|
35
|
+
"@ot-builder/variance": "1.6.3",
|
|
36
|
+
"@ot-builder/common-impl": "1.6.3",
|
|
37
|
+
"@ot-builder/ot-sfnt": "1.6.3",
|
|
38
|
+
"@ot-builder/io-bin-sfnt": "1.6.3",
|
|
39
39
|
"tslib": "^2.0.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@ot-builder/io-bin-glyph-store": "1.6.
|
|
43
|
-
"@ot-builder/io-bin-metadata": "1.6.
|
|
44
|
-
"@ot-builder/ot-encoding": "1.6.
|
|
45
|
-
"@ot-builder/io-bin-encoding": "1.6.
|
|
46
|
-
"@ot-builder/test-util": "1.6.
|
|
42
|
+
"@ot-builder/io-bin-glyph-store": "1.6.3",
|
|
43
|
+
"@ot-builder/io-bin-metadata": "1.6.3",
|
|
44
|
+
"@ot-builder/ot-encoding": "1.6.3",
|
|
45
|
+
"@ot-builder/io-bin-encoding": "1.6.3",
|
|
46
|
+
"@ot-builder/test-util": "1.6.3",
|
|
47
47
|
"@types/jest": "^26.0.23",
|
|
48
48
|
"jest": "^29.3.1"
|
|
49
49
|
}
|