@cantoo/fontkit 2.0.4 → 2.0.5
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/dist/browser-module.mjs +28 -28
- package/dist/browser-module.mjs.map +1 -1
- package/dist/browser.cjs +28 -28
- package/dist/browser.cjs.map +1 -1
- package/dist/main.cjs +28 -28
- package/dist/main.cjs.map +1 -1
- package/dist/module.mjs +28 -28
- package/dist/module.mjs.map +1 -1
- package/package.json +2 -1
- package/src/CmapProcessor.js +2 -2
- package/src/DFont.js +5 -5
- package/src/TTFFont.js +11 -15
- package/src/TrueTypeCollection.js +10 -10
- package/src/WOFF2Font.js +0 -6
- package/src/aat/AATFeatureMap.js +21 -22
- package/src/aat/AATLayoutEngine.js +1 -1
- package/src/aat/AATLookupTable.js +2 -2
- package/src/aat/AATMorxProcessor.js +14 -14
- package/src/aat/AATStateMachine.js +3 -3
- package/src/base.js +1 -1
- package/src/cff/CFFDict.js +2 -2
- package/src/cff/CFFFont.js +1 -1
- package/src/cff/CFFIndex.js +4 -4
- package/src/cff/CFFOperand.js +1 -11
- package/src/cff/CFFPrivateDict.js +20 -20
- package/src/cff/CFFStandardStrings.js +67 -67
- package/src/cff/CFFTop.js +58 -58
- package/src/decorators.js +3 -3
- package/src/encodings.js +111 -111
- package/src/glyph/CFFGlyph.js +3 -4
- package/src/glyph/COLRGlyph.js +2 -2
- package/src/glyph/Glyph.js +4 -4
- package/src/glyph/GlyphVariationProcessor.js +23 -28
- package/src/glyph/Path.js +14 -14
- package/src/glyph/SBIXGlyph.js +2 -2
- package/src/glyph/TTFGlyph.js +31 -38
- package/src/glyph/TTFGlyphEncoder.js +26 -26
- package/src/glyph/WOFF2Glyph.js +2 -2
- package/src/layout/GlyphRun.js +3 -3
- package/src/layout/KernProcessor.js +1 -1
- package/src/layout/LayoutEngine.js +13 -14
- package/src/layout/Script.js +25 -25
- package/src/layout/UnicodeLayoutEngine.js +5 -6
- package/src/opentype/GlyphInfo.js +1 -1
- package/src/opentype/GlyphIterator.js +2 -2
- package/src/opentype/OTProcessor.js +8 -8
- package/src/opentype/ShapingPlan.js +1 -2
- package/src/opentype/shapers/ArabicShaper.js +8 -8
- package/src/opentype/shapers/DefaultShaper.js +3 -3
- package/src/opentype/shapers/HangulShaper.js +35 -35
- package/src/opentype/shapers/HebrewShaper.js +5 -5
- package/src/opentype/shapers/IndicShaper.js +20 -20
- package/src/opentype/shapers/ThaiShaper.js +15 -15
- package/src/opentype/shapers/UniversalShaper.js +2 -2
- package/src/opentype/shapers/index.js +33 -33
- package/src/opentype/shapers/indic-data.js +2 -2
- package/src/packages/unicode-properties/data-trie.js +1 -1
- package/src/packages/unicode-properties/data.js +1 -1
- package/src/packages/unicode-properties/dist/index.cjs +1 -1
- package/src/packages/unicode-properties/dist/index.cjs.map +2 -2
- package/src/packages/unicode-properties/dist/index.mjs +1 -1
- package/src/packages/unicode-properties/dist/index.mjs.map +2 -2
- package/src/packages/unicode-properties/generate.js +3 -4
- package/src/packages/unicode-properties/index.js +30 -30
- package/src/packages/unicode-properties/package.json +1 -1
- package/src/packages/unicode-trie/builder.js +18 -22
- package/src/packages/unicode-trie/dist/builder.cjs +6 -9
- package/src/packages/unicode-trie/dist/builder.cjs.map +2 -2
- package/src/packages/unicode-trie/dist/builder.mjs +6 -9
- package/src/packages/unicode-trie/dist/builder.mjs.map +2 -2
- package/src/packages/unicode-trie/dist/index.cjs.map +2 -2
- package/src/packages/unicode-trie/dist/index.mjs.map +2 -2
- package/src/packages/unicode-trie/index.js +1 -2
- package/src/packages/unicode-trie/package.json +1 -1
- package/src/packages/unicode-trie/swap.js +2 -2
- package/src/subset/Subset.js +2 -2
- package/src/subset/TTFSubset.js +5 -5
- package/src/tables/BASE.js +27 -27
- package/src/tables/COLR.js +9 -9
- package/src/tables/CPAL.js +1 -1
- package/src/tables/DSIG.js +7 -7
- package/src/tables/EBDT.js +0 -1
- package/src/tables/EBLC.js +3 -3
- package/src/tables/GDEF.js +17 -17
- package/src/tables/GPOS.js +74 -74
- package/src/tables/GSUB.js +37 -37
- package/src/tables/JSTF.js +16 -16
- package/src/tables/LTSH.js +3 -3
- package/src/tables/OS2.js +49 -49
- package/src/tables/PCLT.js +15 -15
- package/src/tables/VDMX.js +17 -17
- package/src/tables/VORG.js +7 -7
- package/src/tables/WOFF2Directory.js +2 -2
- package/src/tables/WOFFDirectory.js +18 -18
- package/src/tables/aat.js +2 -2
- package/src/tables/cmap.js +63 -63
- package/src/tables/directory.js +14 -14
- package/src/tables/gasp.js +5 -5
- package/src/tables/glyf.js +1 -1
- package/src/tables/hdmx.js +7 -7
- package/src/tables/head.js +16 -16
- package/src/tables/hhea.js +14 -14
- package/src/tables/hmtx.js +2 -2
- package/src/tables/index.js +0 -5
- package/src/tables/just.js +1 -1
- package/src/tables/kern.js +42 -42
- package/src/tables/loca.js +2 -2
- package/src/tables/maxp.js +15 -15
- package/src/tables/morx.js +16 -16
- package/src/tables/name.js +18 -18
- package/src/tables/opentype.js +91 -91
- package/src/tables/post.js +10 -10
- package/src/tables/variations.js +6 -6
- package/src/tables/vhea.js +14 -14
- package/src/tables/vmtx.js +3 -3
package/src/tables/opentype.js
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
import * as r from 'restructure';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// ########################
|
|
4
4
|
// Scripts and Languages #
|
|
5
|
-
|
|
5
|
+
// ########################
|
|
6
6
|
|
|
7
7
|
let LangSysTable = new r.Struct({
|
|
8
|
-
reserved:
|
|
9
|
-
reqFeatureIndex:
|
|
10
|
-
featureCount:
|
|
11
|
-
featureIndexes:
|
|
8
|
+
reserved: new r.Reserved(r.uint16),
|
|
9
|
+
reqFeatureIndex: r.uint16,
|
|
10
|
+
featureCount: r.uint16,
|
|
11
|
+
featureIndexes: new r.Array(r.uint16, 'featureCount')
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
let LangSysRecord = new r.Struct({
|
|
15
|
-
tag:
|
|
16
|
-
langSys:
|
|
15
|
+
tag: new r.String(4),
|
|
16
|
+
langSys: new r.Pointer(r.uint16, LangSysTable, { type: 'parent' })
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
let Script = new r.Struct({
|
|
20
20
|
defaultLangSys: new r.Pointer(r.uint16, LangSysTable),
|
|
21
|
-
count:
|
|
21
|
+
count: r.uint16,
|
|
22
22
|
langSysRecords: new r.Array(LangSysRecord, 'count')
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
let ScriptRecord = new r.Struct({
|
|
26
|
-
tag:
|
|
26
|
+
tag: new r.String(4),
|
|
27
27
|
script: new r.Pointer(r.uint16, Script, { type: 'parent' })
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
export let ScriptList = new r.Array(ScriptRecord, r.uint16);
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
// #######################
|
|
33
33
|
// Features and Lookups #
|
|
34
|
-
|
|
34
|
+
// #######################
|
|
35
35
|
|
|
36
36
|
let FeatureParams = new r.Struct({
|
|
37
|
-
version:
|
|
38
|
-
nameID:
|
|
37
|
+
version: r.uint16, // should be set to 0 according OT spec
|
|
38
|
+
nameID: r.uint16 // OT spec: UI Name ID or uiLabelNameId
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
export let Feature = new r.Struct({
|
|
42
|
-
featureParams:
|
|
43
|
-
lookupCount:
|
|
44
|
-
lookupListIndexes:
|
|
42
|
+
featureParams: new r.Pointer(r.uint16, FeatureParams),
|
|
43
|
+
lookupCount: r.uint16,
|
|
44
|
+
lookupListIndexes: new r.Array(r.uint16, 'lookupCount')
|
|
45
45
|
});
|
|
46
46
|
|
|
47
47
|
let FeatureRecord = new r.Struct({
|
|
48
|
-
tag:
|
|
49
|
-
feature:
|
|
48
|
+
tag: new r.String(4),
|
|
49
|
+
feature: new r.Pointer(r.uint16, Feature, { type: 'parent' })
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
export let FeatureList = new r.Array(FeatureRecord, r.uint16);
|
|
@@ -61,62 +61,62 @@ let LookupFlags = new r.Struct({
|
|
|
61
61
|
|
|
62
62
|
export function LookupList(SubTable) {
|
|
63
63
|
let Lookup = new r.Struct({
|
|
64
|
-
lookupType:
|
|
65
|
-
flags:
|
|
66
|
-
subTableCount:
|
|
67
|
-
subTables:
|
|
68
|
-
markFilteringSet:
|
|
64
|
+
lookupType: r.uint16,
|
|
65
|
+
flags: LookupFlags,
|
|
66
|
+
subTableCount: r.uint16,
|
|
67
|
+
subTables: new r.Array(new r.Pointer(r.uint16, SubTable), 'subTableCount'),
|
|
68
|
+
markFilteringSet: new r.Optional(r.uint16, t => t.flags.flags.useMarkFilteringSet)
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
return new r.LazyArray(new r.Pointer(r.uint16, Lookup), r.uint16);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
// #################
|
|
75
75
|
// Coverage Table #
|
|
76
|
-
|
|
76
|
+
// #################
|
|
77
77
|
|
|
78
78
|
let RangeRecord = new r.Struct({
|
|
79
|
-
start:
|
|
80
|
-
end:
|
|
79
|
+
start: r.uint16,
|
|
80
|
+
end: r.uint16,
|
|
81
81
|
startCoverageIndex: r.uint16
|
|
82
82
|
});
|
|
83
83
|
|
|
84
84
|
export let Coverage = new r.VersionedStruct(r.uint16, {
|
|
85
85
|
1: {
|
|
86
|
-
glyphCount:
|
|
87
|
-
glyphs:
|
|
86
|
+
glyphCount: r.uint16,
|
|
87
|
+
glyphs: new r.Array(r.uint16, 'glyphCount')
|
|
88
88
|
},
|
|
89
89
|
2: {
|
|
90
|
-
rangeCount:
|
|
90
|
+
rangeCount: r.uint16,
|
|
91
91
|
rangeRecords: new r.Array(RangeRecord, 'rangeCount')
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
// #########################
|
|
96
96
|
// Class Definition Table #
|
|
97
|
-
|
|
97
|
+
// #########################
|
|
98
98
|
|
|
99
99
|
let ClassRangeRecord = new r.Struct({
|
|
100
|
-
start:
|
|
101
|
-
end:
|
|
102
|
-
class:
|
|
100
|
+
start: r.uint16,
|
|
101
|
+
end: r.uint16,
|
|
102
|
+
class: r.uint16
|
|
103
103
|
});
|
|
104
104
|
|
|
105
105
|
export let ClassDef = new r.VersionedStruct(r.uint16, {
|
|
106
106
|
1: { // Class array
|
|
107
|
-
startGlyph:
|
|
108
|
-
glyphCount:
|
|
109
|
-
classValueArray:
|
|
107
|
+
startGlyph: r.uint16,
|
|
108
|
+
glyphCount: r.uint16,
|
|
109
|
+
classValueArray: new r.Array(r.uint16, 'glyphCount')
|
|
110
110
|
},
|
|
111
111
|
2: { // Class ranges
|
|
112
|
-
classRangeCount:
|
|
112
|
+
classRangeCount: r.uint16,
|
|
113
113
|
classRangeRecord: new r.Array(ClassRangeRecord, 'classRangeCount')
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
// ###############
|
|
118
118
|
// Device Table #
|
|
119
|
-
|
|
119
|
+
// ###############
|
|
120
120
|
|
|
121
121
|
export let Device = new r.Struct({
|
|
122
122
|
a: r.uint16, // startSize for hinting Device, outerIndex for VariationIndex
|
|
@@ -124,94 +124,94 @@ export let Device = new r.Struct({
|
|
|
124
124
|
deltaFormat: r.uint16
|
|
125
125
|
});
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
// #############################################
|
|
128
128
|
// Contextual Substitution/Positioning Tables #
|
|
129
|
-
|
|
129
|
+
// #############################################
|
|
130
130
|
|
|
131
131
|
let LookupRecord = new r.Struct({
|
|
132
|
-
sequenceIndex:
|
|
133
|
-
lookupListIndex:
|
|
132
|
+
sequenceIndex: r.uint16,
|
|
133
|
+
lookupListIndex: r.uint16
|
|
134
134
|
});
|
|
135
135
|
|
|
136
136
|
let Rule = new r.Struct({
|
|
137
|
-
glyphCount:
|
|
138
|
-
lookupCount:
|
|
139
|
-
input:
|
|
140
|
-
lookupRecords:
|
|
137
|
+
glyphCount: r.uint16,
|
|
138
|
+
lookupCount: r.uint16,
|
|
139
|
+
input: new r.Array(r.uint16, t => t.glyphCount - 1),
|
|
140
|
+
lookupRecords: new r.Array(LookupRecord, 'lookupCount')
|
|
141
141
|
});
|
|
142
142
|
|
|
143
143
|
let RuleSet = new r.Array(new r.Pointer(r.uint16, Rule), r.uint16);
|
|
144
144
|
|
|
145
145
|
let ClassRule = new r.Struct({
|
|
146
|
-
glyphCount:
|
|
147
|
-
lookupCount:
|
|
148
|
-
classes:
|
|
149
|
-
lookupRecords:
|
|
146
|
+
glyphCount: r.uint16,
|
|
147
|
+
lookupCount: r.uint16,
|
|
148
|
+
classes: new r.Array(r.uint16, t => t.glyphCount - 1),
|
|
149
|
+
lookupRecords: new r.Array(LookupRecord, 'lookupCount')
|
|
150
150
|
});
|
|
151
151
|
|
|
152
152
|
let ClassSet = new r.Array(new r.Pointer(r.uint16, ClassRule), r.uint16);
|
|
153
153
|
|
|
154
154
|
export let Context = new r.VersionedStruct(r.uint16, {
|
|
155
155
|
1: { // Simple context
|
|
156
|
-
coverage:
|
|
157
|
-
ruleSetCount:
|
|
158
|
-
ruleSets:
|
|
156
|
+
coverage: new r.Pointer(r.uint16, Coverage),
|
|
157
|
+
ruleSetCount: r.uint16,
|
|
158
|
+
ruleSets: new r.Array(new r.Pointer(r.uint16, RuleSet), 'ruleSetCount')
|
|
159
159
|
},
|
|
160
160
|
2: { // Class-based context
|
|
161
|
-
coverage:
|
|
162
|
-
classDef:
|
|
163
|
-
classSetCnt:
|
|
164
|
-
classSet:
|
|
161
|
+
coverage: new r.Pointer(r.uint16, Coverage),
|
|
162
|
+
classDef: new r.Pointer(r.uint16, ClassDef),
|
|
163
|
+
classSetCnt: r.uint16,
|
|
164
|
+
classSet: new r.Array(new r.Pointer(r.uint16, ClassSet), 'classSetCnt')
|
|
165
165
|
},
|
|
166
166
|
3: {
|
|
167
|
-
glyphCount:
|
|
168
|
-
lookupCount:
|
|
169
|
-
coverages:
|
|
167
|
+
glyphCount: r.uint16,
|
|
168
|
+
lookupCount: r.uint16,
|
|
169
|
+
coverages: new r.Array(new r.Pointer(r.uint16, Coverage), 'glyphCount'),
|
|
170
170
|
lookupRecords: new r.Array(LookupRecord, 'lookupCount')
|
|
171
171
|
}
|
|
172
172
|
});
|
|
173
173
|
|
|
174
|
-
|
|
174
|
+
// ######################################################
|
|
175
175
|
// Chaining Contextual Substitution/Positioning Tables #
|
|
176
|
-
|
|
176
|
+
// ######################################################
|
|
177
177
|
|
|
178
178
|
let ChainRule = new r.Struct({
|
|
179
|
-
backtrackGlyphCount:
|
|
180
|
-
backtrack:
|
|
181
|
-
inputGlyphCount:
|
|
182
|
-
input:
|
|
183
|
-
lookaheadGlyphCount:
|
|
184
|
-
lookahead:
|
|
185
|
-
lookupCount:
|
|
186
|
-
lookupRecords:
|
|
179
|
+
backtrackGlyphCount: r.uint16,
|
|
180
|
+
backtrack: new r.Array(r.uint16, 'backtrackGlyphCount'),
|
|
181
|
+
inputGlyphCount: r.uint16,
|
|
182
|
+
input: new r.Array(r.uint16, t => t.inputGlyphCount - 1),
|
|
183
|
+
lookaheadGlyphCount: r.uint16,
|
|
184
|
+
lookahead: new r.Array(r.uint16, 'lookaheadGlyphCount'),
|
|
185
|
+
lookupCount: r.uint16,
|
|
186
|
+
lookupRecords: new r.Array(LookupRecord, 'lookupCount')
|
|
187
187
|
});
|
|
188
188
|
|
|
189
189
|
let ChainRuleSet = new r.Array(new r.Pointer(r.uint16, ChainRule), r.uint16);
|
|
190
190
|
|
|
191
191
|
export let ChainingContext = new r.VersionedStruct(r.uint16, {
|
|
192
192
|
1: { // Simple context glyph substitution
|
|
193
|
-
coverage:
|
|
194
|
-
chainCount:
|
|
195
|
-
chainRuleSets:
|
|
193
|
+
coverage: new r.Pointer(r.uint16, Coverage),
|
|
194
|
+
chainCount: r.uint16,
|
|
195
|
+
chainRuleSets: new r.Array(new r.Pointer(r.uint16, ChainRuleSet), 'chainCount')
|
|
196
196
|
},
|
|
197
197
|
|
|
198
198
|
2: { // Class-based chaining context
|
|
199
|
-
coverage:
|
|
200
|
-
backtrackClassDef:
|
|
201
|
-
inputClassDef:
|
|
202
|
-
lookaheadClassDef:
|
|
203
|
-
chainCount:
|
|
204
|
-
chainClassSet:
|
|
199
|
+
coverage: new r.Pointer(r.uint16, Coverage),
|
|
200
|
+
backtrackClassDef: new r.Pointer(r.uint16, ClassDef),
|
|
201
|
+
inputClassDef: new r.Pointer(r.uint16, ClassDef),
|
|
202
|
+
lookaheadClassDef: new r.Pointer(r.uint16, ClassDef),
|
|
203
|
+
chainCount: r.uint16,
|
|
204
|
+
chainClassSet: new r.Array(new r.Pointer(r.uint16, ChainRuleSet), 'chainCount')
|
|
205
205
|
},
|
|
206
206
|
|
|
207
207
|
3: { // Coverage-based chaining context
|
|
208
|
-
backtrackGlyphCount:
|
|
209
|
-
backtrackCoverage:
|
|
210
|
-
inputGlyphCount:
|
|
211
|
-
inputCoverage:
|
|
212
|
-
lookaheadGlyphCount:
|
|
213
|
-
lookaheadCoverage:
|
|
214
|
-
lookupCount:
|
|
215
|
-
lookupRecords:
|
|
208
|
+
backtrackGlyphCount: r.uint16,
|
|
209
|
+
backtrackCoverage: new r.Array(new r.Pointer(r.uint16, Coverage), 'backtrackGlyphCount'),
|
|
210
|
+
inputGlyphCount: r.uint16,
|
|
211
|
+
inputCoverage: new r.Array(new r.Pointer(r.uint16, Coverage), 'inputGlyphCount'),
|
|
212
|
+
lookaheadGlyphCount: r.uint16,
|
|
213
|
+
lookaheadCoverage: new r.Array(new r.Pointer(r.uint16, Coverage), 'lookaheadGlyphCount'),
|
|
214
|
+
lookupCount: r.uint16,
|
|
215
|
+
lookupRecords: new r.Array(LookupRecord, 'lookupCount')
|
|
216
216
|
}
|
|
217
217
|
});
|
package/src/tables/post.js
CHANGED
|
@@ -3,14 +3,14 @@ import * as r from 'restructure';
|
|
|
3
3
|
// PostScript information
|
|
4
4
|
export default new r.VersionedStruct(r.fixed32, {
|
|
5
5
|
header: { // these fields exist at the top of all versions
|
|
6
|
-
italicAngle:
|
|
7
|
-
underlinePosition:
|
|
8
|
-
underlineThickness: r.int16,
|
|
9
|
-
isFixedPitch:
|
|
10
|
-
minMemType42:
|
|
11
|
-
maxMemType42:
|
|
12
|
-
minMemType1:
|
|
13
|
-
maxMemType1:
|
|
6
|
+
italicAngle: r.fixed32, // Italic angle in counter-clockwise degrees from the vertical.
|
|
7
|
+
underlinePosition: r.int16, // Suggested distance of the top of the underline from the baseline
|
|
8
|
+
underlineThickness: r.int16, // Suggested values for the underline thickness
|
|
9
|
+
isFixedPitch: r.uint32, // Whether the font is monospaced
|
|
10
|
+
minMemType42: r.uint32, // Minimum memory usage when a TrueType font is downloaded as a Type 42 font
|
|
11
|
+
maxMemType42: r.uint32, // Maximum memory usage when a TrueType font is downloaded as a Type 42 font
|
|
12
|
+
minMemType1: r.uint32, // Minimum memory usage when a TrueType font is downloaded as a Type 1 font
|
|
13
|
+
maxMemType1: r.uint32 // Maximum memory usage when a TrueType font is downloaded as a Type 1 font
|
|
14
14
|
},
|
|
15
15
|
|
|
16
16
|
1: {}, // version 1 has no additional fields
|
|
@@ -18,12 +18,12 @@ export default new r.VersionedStruct(r.fixed32, {
|
|
|
18
18
|
2: {
|
|
19
19
|
numberOfGlyphs: r.uint16,
|
|
20
20
|
glyphNameIndex: new r.Array(r.uint16, 'numberOfGlyphs'),
|
|
21
|
-
names:
|
|
21
|
+
names: new r.Array(new r.String(r.uint8))
|
|
22
22
|
},
|
|
23
23
|
|
|
24
24
|
2.5: {
|
|
25
25
|
numberOfGlyphs: r.uint16,
|
|
26
|
-
offsets:
|
|
26
|
+
offsets: new r.Array(r.uint8, 'numberOfGlyphs')
|
|
27
27
|
},
|
|
28
28
|
|
|
29
29
|
3: {}, // version 3 has no additional fields
|
package/src/tables/variations.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {Feature} from './opentype';
|
|
1
|
+
import { Feature } from './opentype';
|
|
2
2
|
import * as r from 'restructure';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/** *****************
|
|
5
5
|
* Variation Store *
|
|
6
6
|
*******************/
|
|
7
7
|
|
|
@@ -39,7 +39,7 @@ export let ItemVariationStore = new r.Struct({
|
|
|
39
39
|
itemVariationData: new r.Array(new r.Pointer(r.uint32, ItemVariationData), 'variationDataCount')
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
/** ********************
|
|
43
43
|
* Feature Variations *
|
|
44
44
|
**********************/
|
|
45
45
|
|
|
@@ -58,7 +58,7 @@ let ConditionSet = new r.Struct({
|
|
|
58
58
|
|
|
59
59
|
let FeatureTableSubstitutionRecord = new r.Struct({
|
|
60
60
|
featureIndex: r.uint16,
|
|
61
|
-
alternateFeatureTable: new r.Pointer(r.uint32, Feature, {type: 'parent'})
|
|
61
|
+
alternateFeatureTable: new r.Pointer(r.uint32, Feature, { type: 'parent' })
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
let FeatureTableSubstitution = new r.Struct({
|
|
@@ -68,8 +68,8 @@ let FeatureTableSubstitution = new r.Struct({
|
|
|
68
68
|
});
|
|
69
69
|
|
|
70
70
|
let FeatureVariationRecord = new r.Struct({
|
|
71
|
-
conditionSet: new r.Pointer(r.uint32, ConditionSet, {type: 'parent'}),
|
|
72
|
-
featureTableSubstitution: new r.Pointer(r.uint32, FeatureTableSubstitution, {type: 'parent'})
|
|
71
|
+
conditionSet: new r.Pointer(r.uint32, ConditionSet, { type: 'parent' }),
|
|
72
|
+
featureTableSubstitution: new r.Pointer(r.uint32, FeatureTableSubstitution, { type: 'parent' })
|
|
73
73
|
});
|
|
74
74
|
|
|
75
75
|
export let FeatureVariations = new r.Struct({
|
package/src/tables/vhea.js
CHANGED
|
@@ -2,18 +2,18 @@ import * as r from 'restructure';
|
|
|
2
2
|
|
|
3
3
|
// Vertical Header Table
|
|
4
4
|
export default new r.Struct({
|
|
5
|
-
version:
|
|
6
|
-
ascent:
|
|
7
|
-
descent:
|
|
8
|
-
lineGap:
|
|
9
|
-
advanceHeightMax:
|
|
10
|
-
minTopSideBearing:
|
|
11
|
-
minBottomSideBearing:
|
|
12
|
-
yMaxExtent:
|
|
13
|
-
caretSlopeRise:
|
|
14
|
-
caretSlopeRun:
|
|
15
|
-
caretOffset:
|
|
16
|
-
reserved:
|
|
17
|
-
metricDataFormat:
|
|
18
|
-
numberOfMetrics:
|
|
5
|
+
version: r.fixed32, // Version number of the Vertical Header Table
|
|
6
|
+
ascent: r.int16, // The vertical typographic ascender for this font
|
|
7
|
+
descent: r.int16, // The vertical typographic descender for this font
|
|
8
|
+
lineGap: r.int16, // The vertical typographic line gap for this font
|
|
9
|
+
advanceHeightMax: r.uint16, // The maximum advance height measurement found in the font
|
|
10
|
+
minTopSideBearing: r.int16, // The minimum top side bearing measurement found in the font
|
|
11
|
+
minBottomSideBearing: r.int16, // The minimum bottom side bearing measurement found in the font
|
|
12
|
+
yMaxExtent: r.int16,
|
|
13
|
+
caretSlopeRise: r.int16, // Caret slope (rise/run)
|
|
14
|
+
caretSlopeRun: r.int16,
|
|
15
|
+
caretOffset: r.int16, // Set value equal to 0 for nonslanted fonts
|
|
16
|
+
reserved: new r.Reserved(r.int16, 4),
|
|
17
|
+
metricDataFormat: r.int16, // Set to 0
|
|
18
|
+
numberOfMetrics: r.uint16 // Number of advance heights in the Vertical Metrics table
|
|
19
19
|
});
|
package/src/tables/vmtx.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as r from 'restructure';
|
|
2
2
|
|
|
3
3
|
let VmtxEntry = new r.Struct({
|
|
4
|
-
advance: r.uint16,
|
|
5
|
-
bearing: r.int16
|
|
4
|
+
advance: r.uint16, // The advance height of the glyph
|
|
5
|
+
bearing: r.int16 // The top sidebearing of the glyph
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
// Vertical Metrics Table
|
|
9
9
|
export default new r.Struct({
|
|
10
|
-
metrics:
|
|
10
|
+
metrics: new r.LazyArray(VmtxEntry, t => t.parent.vhea.numberOfMetrics),
|
|
11
11
|
bearings: new r.LazyArray(r.int16, t => t.parent.maxp.numGlyphs - t.parent.vhea.numberOfMetrics)
|
|
12
12
|
});
|