@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.
Files changed (115) hide show
  1. package/dist/browser-module.mjs +28 -28
  2. package/dist/browser-module.mjs.map +1 -1
  3. package/dist/browser.cjs +28 -28
  4. package/dist/browser.cjs.map +1 -1
  5. package/dist/main.cjs +28 -28
  6. package/dist/main.cjs.map +1 -1
  7. package/dist/module.mjs +28 -28
  8. package/dist/module.mjs.map +1 -1
  9. package/package.json +2 -1
  10. package/src/CmapProcessor.js +2 -2
  11. package/src/DFont.js +5 -5
  12. package/src/TTFFont.js +11 -15
  13. package/src/TrueTypeCollection.js +10 -10
  14. package/src/WOFF2Font.js +0 -6
  15. package/src/aat/AATFeatureMap.js +21 -22
  16. package/src/aat/AATLayoutEngine.js +1 -1
  17. package/src/aat/AATLookupTable.js +2 -2
  18. package/src/aat/AATMorxProcessor.js +14 -14
  19. package/src/aat/AATStateMachine.js +3 -3
  20. package/src/base.js +1 -1
  21. package/src/cff/CFFDict.js +2 -2
  22. package/src/cff/CFFFont.js +1 -1
  23. package/src/cff/CFFIndex.js +4 -4
  24. package/src/cff/CFFOperand.js +1 -11
  25. package/src/cff/CFFPrivateDict.js +20 -20
  26. package/src/cff/CFFStandardStrings.js +67 -67
  27. package/src/cff/CFFTop.js +58 -58
  28. package/src/decorators.js +3 -3
  29. package/src/encodings.js +111 -111
  30. package/src/glyph/CFFGlyph.js +3 -4
  31. package/src/glyph/COLRGlyph.js +2 -2
  32. package/src/glyph/Glyph.js +4 -4
  33. package/src/glyph/GlyphVariationProcessor.js +23 -28
  34. package/src/glyph/Path.js +14 -14
  35. package/src/glyph/SBIXGlyph.js +2 -2
  36. package/src/glyph/TTFGlyph.js +31 -38
  37. package/src/glyph/TTFGlyphEncoder.js +26 -26
  38. package/src/glyph/WOFF2Glyph.js +2 -2
  39. package/src/layout/GlyphRun.js +3 -3
  40. package/src/layout/KernProcessor.js +1 -1
  41. package/src/layout/LayoutEngine.js +13 -14
  42. package/src/layout/Script.js +25 -25
  43. package/src/layout/UnicodeLayoutEngine.js +5 -6
  44. package/src/opentype/GlyphInfo.js +1 -1
  45. package/src/opentype/GlyphIterator.js +2 -2
  46. package/src/opentype/OTProcessor.js +8 -8
  47. package/src/opentype/ShapingPlan.js +1 -2
  48. package/src/opentype/shapers/ArabicShaper.js +8 -8
  49. package/src/opentype/shapers/DefaultShaper.js +3 -3
  50. package/src/opentype/shapers/HangulShaper.js +35 -35
  51. package/src/opentype/shapers/HebrewShaper.js +5 -5
  52. package/src/opentype/shapers/IndicShaper.js +20 -20
  53. package/src/opentype/shapers/ThaiShaper.js +15 -15
  54. package/src/opentype/shapers/UniversalShaper.js +2 -2
  55. package/src/opentype/shapers/index.js +33 -33
  56. package/src/opentype/shapers/indic-data.js +2 -2
  57. package/src/packages/unicode-properties/data-trie.js +1 -1
  58. package/src/packages/unicode-properties/data.js +1 -1
  59. package/src/packages/unicode-properties/dist/index.cjs +1 -1
  60. package/src/packages/unicode-properties/dist/index.cjs.map +2 -2
  61. package/src/packages/unicode-properties/dist/index.mjs +1 -1
  62. package/src/packages/unicode-properties/dist/index.mjs.map +2 -2
  63. package/src/packages/unicode-properties/generate.js +3 -4
  64. package/src/packages/unicode-properties/index.js +30 -30
  65. package/src/packages/unicode-properties/package.json +1 -1
  66. package/src/packages/unicode-trie/builder.js +18 -22
  67. package/src/packages/unicode-trie/dist/builder.cjs +6 -9
  68. package/src/packages/unicode-trie/dist/builder.cjs.map +2 -2
  69. package/src/packages/unicode-trie/dist/builder.mjs +6 -9
  70. package/src/packages/unicode-trie/dist/builder.mjs.map +2 -2
  71. package/src/packages/unicode-trie/dist/index.cjs.map +2 -2
  72. package/src/packages/unicode-trie/dist/index.mjs.map +2 -2
  73. package/src/packages/unicode-trie/index.js +1 -2
  74. package/src/packages/unicode-trie/package.json +1 -1
  75. package/src/packages/unicode-trie/swap.js +2 -2
  76. package/src/subset/Subset.js +2 -2
  77. package/src/subset/TTFSubset.js +5 -5
  78. package/src/tables/BASE.js +27 -27
  79. package/src/tables/COLR.js +9 -9
  80. package/src/tables/CPAL.js +1 -1
  81. package/src/tables/DSIG.js +7 -7
  82. package/src/tables/EBDT.js +0 -1
  83. package/src/tables/EBLC.js +3 -3
  84. package/src/tables/GDEF.js +17 -17
  85. package/src/tables/GPOS.js +74 -74
  86. package/src/tables/GSUB.js +37 -37
  87. package/src/tables/JSTF.js +16 -16
  88. package/src/tables/LTSH.js +3 -3
  89. package/src/tables/OS2.js +49 -49
  90. package/src/tables/PCLT.js +15 -15
  91. package/src/tables/VDMX.js +17 -17
  92. package/src/tables/VORG.js +7 -7
  93. package/src/tables/WOFF2Directory.js +2 -2
  94. package/src/tables/WOFFDirectory.js +18 -18
  95. package/src/tables/aat.js +2 -2
  96. package/src/tables/cmap.js +63 -63
  97. package/src/tables/directory.js +14 -14
  98. package/src/tables/gasp.js +5 -5
  99. package/src/tables/glyf.js +1 -1
  100. package/src/tables/hdmx.js +7 -7
  101. package/src/tables/head.js +16 -16
  102. package/src/tables/hhea.js +14 -14
  103. package/src/tables/hmtx.js +2 -2
  104. package/src/tables/index.js +0 -5
  105. package/src/tables/just.js +1 -1
  106. package/src/tables/kern.js +42 -42
  107. package/src/tables/loca.js +2 -2
  108. package/src/tables/maxp.js +15 -15
  109. package/src/tables/morx.js +16 -16
  110. package/src/tables/name.js +18 -18
  111. package/src/tables/opentype.js +91 -91
  112. package/src/tables/post.js +10 -10
  113. package/src/tables/variations.js +6 -6
  114. package/src/tables/vhea.js +14 -14
  115. package/src/tables/vmtx.js +3 -3
@@ -7,15 +7,15 @@ let Signature = new r.Struct({
7
7
  });
8
8
 
9
9
  let SignatureBlock = new r.Struct({
10
- reserved: new r.Reserved(r.uint16, 2),
11
- cbSignature: r.uint32, // Length (in bytes) of the PKCS#7 packet in pbSignature
12
- signature: new r.Buffer('cbSignature')
10
+ reserved: new r.Reserved(r.uint16, 2),
11
+ cbSignature: r.uint32, // Length (in bytes) of the PKCS#7 packet in pbSignature
12
+ signature: new r.Buffer('cbSignature')
13
13
  });
14
14
 
15
15
  export default new r.Struct({
16
- ulVersion: r.uint32, // Version number of the DSIG table (0x00000001)
17
- usNumSigs: r.uint16, // Number of signatures in the table
18
- usFlag: r.uint16, // Permission flags
19
- signatures: new r.Array(Signature, 'usNumSigs'),
16
+ ulVersion: r.uint32, // Version number of the DSIG table (0x00000001)
17
+ usNumSigs: r.uint16, // Number of signatures in the table
18
+ usFlag: r.uint16, // Permission flags
19
+ signatures: new r.Array(Signature, 'usNumSigs'),
20
20
  signatureBlocks: new r.Array(SignatureBlock, 'usNumSigs')
21
21
  });
@@ -88,4 +88,3 @@ export let glyph = new r.VersionedStruct('version', {
88
88
  data: new r.Buffer('dataLen')
89
89
  }
90
90
  });
91
-
@@ -1,5 +1,5 @@
1
1
  import * as r from 'restructure';
2
- import {BigMetrics} from './EBDT';
2
+ import { BigMetrics } from './EBDT';
3
3
 
4
4
  let SBitLineMetrics = new r.Struct({
5
5
  ascender: r.int8,
@@ -74,7 +74,7 @@ let BitmapSizeTable = new r.Struct({
74
74
  });
75
75
 
76
76
  export default new r.Struct({
77
- version: r.uint32, // 0x00020000
77
+ version: r.uint32, // 0x00020000
78
78
  numSizes: r.uint32,
79
- sizes: new r.Array(BitmapSizeTable, 'numSizes')
79
+ sizes: new r.Array(BitmapSizeTable, 'numSizes')
80
80
  });
@@ -1,12 +1,12 @@
1
1
  import * as r from 'restructure';
2
- import {Coverage, ClassDef, Device} from './opentype';
3
- import {ItemVariationStore} from './variations';
2
+ import { Coverage, ClassDef, Device } from './opentype';
3
+ import { ItemVariationStore } from './variations';
4
4
 
5
5
  let AttachPoint = new r.Array(r.uint16, r.uint16);
6
6
  let AttachList = new r.Struct({
7
- coverage: new r.Pointer(r.uint16, Coverage),
8
- glyphCount: r.uint16,
9
- attachPoints: new r.Array(new r.Pointer(r.uint16, AttachPoint), 'glyphCount')
7
+ coverage: new r.Pointer(r.uint16, Coverage),
8
+ glyphCount: r.uint16,
9
+ attachPoints: new r.Array(new r.Pointer(r.uint16, AttachPoint), 'glyphCount')
10
10
  });
11
11
 
12
12
  let CaretValue = new r.VersionedStruct(r.uint16, {
@@ -19,39 +19,39 @@ let CaretValue = new r.VersionedStruct(r.uint16, {
19
19
  },
20
20
 
21
21
  3: { // Design units plus Device table
22
- coordinate: r.int16,
23
- deviceTable: new r.Pointer(r.uint16, Device)
22
+ coordinate: r.int16,
23
+ deviceTable: new r.Pointer(r.uint16, Device)
24
24
  }
25
25
  });
26
26
 
27
27
  let LigGlyph = new r.Array(new r.Pointer(r.uint16, CaretValue), r.uint16);
28
28
 
29
29
  let LigCaretList = new r.Struct({
30
- coverage: new r.Pointer(r.uint16, Coverage),
31
- ligGlyphCount: r.uint16,
32
- ligGlyphs: new r.Array(new r.Pointer(r.uint16, LigGlyph), 'ligGlyphCount')
30
+ coverage: new r.Pointer(r.uint16, Coverage),
31
+ ligGlyphCount: r.uint16,
32
+ ligGlyphs: new r.Array(new r.Pointer(r.uint16, LigGlyph), 'ligGlyphCount')
33
33
  });
34
34
 
35
35
  let MarkGlyphSetsDef = new r.Struct({
36
36
  markSetTableFormat: r.uint16,
37
- markSetCount: r.uint16,
38
- coverage: new r.Array(new r.Pointer(r.uint32, Coverage), 'markSetCount')
37
+ markSetCount: r.uint16,
38
+ coverage: new r.Array(new r.Pointer(r.uint32, Coverage), 'markSetCount')
39
39
  });
40
40
 
41
41
  export default new r.VersionedStruct(r.uint32, {
42
42
  header: {
43
- glyphClassDef: new r.Pointer(r.uint16, ClassDef),
44
- attachList: new r.Pointer(r.uint16, AttachList),
45
- ligCaretList: new r.Pointer(r.uint16, LigCaretList),
43
+ glyphClassDef: new r.Pointer(r.uint16, ClassDef),
44
+ attachList: new r.Pointer(r.uint16, AttachList),
45
+ ligCaretList: new r.Pointer(r.uint16, LigCaretList),
46
46
  markAttachClassDef: new r.Pointer(r.uint16, ClassDef)
47
47
  },
48
48
 
49
49
  0x00010000: {},
50
50
  0x00010002: {
51
- markGlyphSetsDef: new r.Pointer(r.uint16, MarkGlyphSetsDef)
51
+ markGlyphSetsDef: new r.Pointer(r.uint16, MarkGlyphSetsDef)
52
52
  },
53
53
  0x00010003: {
54
- markGlyphSetsDef: new r.Pointer(r.uint16, MarkGlyphSetsDef),
54
+ markGlyphSetsDef: new r.Pointer(r.uint16, MarkGlyphSetsDef),
55
55
  itemVariationStore: new r.Pointer(r.uint32, ItemVariationStore)
56
56
  }
57
57
  });
@@ -1,6 +1,6 @@
1
1
  import * as r from 'restructure';
2
- import {ScriptList, FeatureList, LookupList, Coverage, ClassDef, Device, Context, ChainingContext} from './opentype';
3
- import {FeatureVariations} from './variations';
2
+ import { ScriptList, FeatureList, LookupList, Coverage, ClassDef, Device, Context, ChainingContext } from './opentype';
3
+ import { FeatureVariations } from './variations';
4
4
 
5
5
  let ValueFormat = new r.Bitfield(r.uint16, [
6
6
  'xPlacement', 'yPlacement',
@@ -12,8 +12,8 @@ let ValueFormat = new r.Bitfield(r.uint16, [
12
12
  let types = {
13
13
  xPlacement: r.int16,
14
14
  yPlacement: r.int16,
15
- xAdvance: r.int16,
16
- yAdvance: r.int16,
15
+ xAdvance: r.int16,
16
+ yAdvance: r.int16,
17
17
  xPlaDevice: new r.Pointer(r.uint16, Device, { type: 'global', relativeTo: ctx => ctx.rel }),
18
18
  yPlaDevice: new r.Pointer(r.uint16, Device, { type: 'global', relativeTo: ctx => ctx.rel }),
19
19
  xAdvDevice: new r.Pointer(r.uint16, Device, { type: 'global', relativeTo: ctx => ctx.rel }),
@@ -58,9 +58,9 @@ class ValueRecord {
58
58
  }
59
59
 
60
60
  let PairValueRecord = new r.Struct({
61
- secondGlyph: r.uint16,
62
- value1: new ValueRecord('valueFormat1'),
63
- value2: new ValueRecord('valueFormat2')
61
+ secondGlyph: r.uint16,
62
+ value1: new ValueRecord('valueFormat1'),
63
+ value2: new ValueRecord('valueFormat2')
64
64
  });
65
65
 
66
66
  let PairSet = new r.Array(PairValueRecord, r.uint16);
@@ -72,120 +72,120 @@ let Class2Record = new r.Struct({
72
72
 
73
73
  let Anchor = new r.VersionedStruct(r.uint16, {
74
74
  1: { // Design units only
75
- xCoordinate: r.int16,
76
- yCoordinate: r.int16
75
+ xCoordinate: r.int16,
76
+ yCoordinate: r.int16
77
77
  },
78
78
 
79
79
  2: { // Design units plus contour point
80
- xCoordinate: r.int16,
81
- yCoordinate: r.int16,
82
- anchorPoint: r.uint16
80
+ xCoordinate: r.int16,
81
+ yCoordinate: r.int16,
82
+ anchorPoint: r.uint16
83
83
  },
84
84
 
85
85
  3: { // Design units plus Device tables
86
- xCoordinate: r.int16,
87
- yCoordinate: r.int16,
88
- xDeviceTable: new r.Pointer(r.uint16, Device),
89
- yDeviceTable: new r.Pointer(r.uint16, Device)
86
+ xCoordinate: r.int16,
87
+ yCoordinate: r.int16,
88
+ xDeviceTable: new r.Pointer(r.uint16, Device),
89
+ yDeviceTable: new r.Pointer(r.uint16, Device)
90
90
  }
91
91
  });
92
92
 
93
93
  let EntryExitRecord = new r.Struct({
94
- entryAnchor: new r.Pointer(r.uint16, Anchor, {type: 'parent'}),
95
- exitAnchor: new r.Pointer(r.uint16, Anchor, {type: 'parent'})
94
+ entryAnchor: new r.Pointer(r.uint16, Anchor, { type: 'parent' }),
95
+ exitAnchor: new r.Pointer(r.uint16, Anchor, { type: 'parent' })
96
96
  });
97
97
 
98
98
  let MarkRecord = new r.Struct({
99
- class: r.uint16,
100
- markAnchor: new r.Pointer(r.uint16, Anchor, {type: 'parent'})
99
+ class: r.uint16,
100
+ markAnchor: new r.Pointer(r.uint16, Anchor, { type: 'parent' })
101
101
  });
102
102
 
103
103
  let MarkArray = new r.Array(MarkRecord, r.uint16);
104
104
 
105
- let BaseRecord = new r.Array(new r.Pointer(r.uint16, Anchor), t => t.parent.classCount);
106
- let BaseArray = new r.Array(BaseRecord, r.uint16);
105
+ let BaseRecord = new r.Array(new r.Pointer(r.uint16, Anchor), t => t.parent.classCount);
106
+ let BaseArray = new r.Array(BaseRecord, r.uint16);
107
107
 
108
108
  let ComponentRecord = new r.Array(new r.Pointer(r.uint16, Anchor), t => t.parent.parent.classCount);
109
- let LigatureAttach = new r.Array(ComponentRecord, r.uint16);
110
- let LigatureArray = new r.Array(new r.Pointer(r.uint16, LigatureAttach), r.uint16);
109
+ let LigatureAttach = new r.Array(ComponentRecord, r.uint16);
110
+ let LigatureArray = new r.Array(new r.Pointer(r.uint16, LigatureAttach), r.uint16);
111
111
 
112
112
  let GPOSLookup = new r.VersionedStruct('lookupType', {
113
113
  1: new r.VersionedStruct(r.uint16, { // Single Adjustment
114
114
  1: { // Single positioning value
115
- coverage: new r.Pointer(r.uint16, Coverage),
116
- valueFormat: ValueFormat,
117
- value: new ValueRecord()
115
+ coverage: new r.Pointer(r.uint16, Coverage),
116
+ valueFormat: ValueFormat,
117
+ value: new ValueRecord()
118
118
  },
119
119
  2: {
120
- coverage: new r.Pointer(r.uint16, Coverage),
121
- valueFormat: ValueFormat,
122
- valueCount: r.uint16,
123
- values: new r.LazyArray(new ValueRecord(), 'valueCount')
120
+ coverage: new r.Pointer(r.uint16, Coverage),
121
+ valueFormat: ValueFormat,
122
+ valueCount: r.uint16,
123
+ values: new r.LazyArray(new ValueRecord(), 'valueCount')
124
124
  }
125
125
  }),
126
126
 
127
127
  2: new r.VersionedStruct(r.uint16, { // Pair Adjustment Positioning
128
128
  1: { // Adjustments for glyph pairs
129
- coverage: new r.Pointer(r.uint16, Coverage),
130
- valueFormat1: ValueFormat,
131
- valueFormat2: ValueFormat,
132
- pairSetCount: r.uint16,
133
- pairSets: new r.LazyArray(new r.Pointer(r.uint16, PairSet), 'pairSetCount')
129
+ coverage: new r.Pointer(r.uint16, Coverage),
130
+ valueFormat1: ValueFormat,
131
+ valueFormat2: ValueFormat,
132
+ pairSetCount: r.uint16,
133
+ pairSets: new r.LazyArray(new r.Pointer(r.uint16, PairSet), 'pairSetCount')
134
134
  },
135
135
 
136
136
  2: { // Class pair adjustment
137
- coverage: new r.Pointer(r.uint16, Coverage),
138
- valueFormat1: ValueFormat,
139
- valueFormat2: ValueFormat,
140
- classDef1: new r.Pointer(r.uint16, ClassDef),
141
- classDef2: new r.Pointer(r.uint16, ClassDef),
142
- class1Count: r.uint16,
143
- class2Count: r.uint16,
144
- classRecords: new r.LazyArray(new r.LazyArray(Class2Record, 'class2Count'), 'class1Count')
137
+ coverage: new r.Pointer(r.uint16, Coverage),
138
+ valueFormat1: ValueFormat,
139
+ valueFormat2: ValueFormat,
140
+ classDef1: new r.Pointer(r.uint16, ClassDef),
141
+ classDef2: new r.Pointer(r.uint16, ClassDef),
142
+ class1Count: r.uint16,
143
+ class2Count: r.uint16,
144
+ classRecords: new r.LazyArray(new r.LazyArray(Class2Record, 'class2Count'), 'class1Count')
145
145
  }
146
146
  }),
147
147
 
148
148
  3: { // Cursive Attachment Positioning
149
- format: r.uint16,
150
- coverage: new r.Pointer(r.uint16, Coverage),
151
- entryExitCount: r.uint16,
152
- entryExitRecords: new r.Array(EntryExitRecord, 'entryExitCount')
149
+ format: r.uint16,
150
+ coverage: new r.Pointer(r.uint16, Coverage),
151
+ entryExitCount: r.uint16,
152
+ entryExitRecords: new r.Array(EntryExitRecord, 'entryExitCount')
153
153
  },
154
154
 
155
155
  4: { // MarkToBase Attachment Positioning
156
- format: r.uint16,
157
- markCoverage: new r.Pointer(r.uint16, Coverage),
158
- baseCoverage: new r.Pointer(r.uint16, Coverage),
159
- classCount: r.uint16,
160
- markArray: new r.Pointer(r.uint16, MarkArray),
161
- baseArray: new r.Pointer(r.uint16, BaseArray)
156
+ format: r.uint16,
157
+ markCoverage: new r.Pointer(r.uint16, Coverage),
158
+ baseCoverage: new r.Pointer(r.uint16, Coverage),
159
+ classCount: r.uint16,
160
+ markArray: new r.Pointer(r.uint16, MarkArray),
161
+ baseArray: new r.Pointer(r.uint16, BaseArray)
162
162
  },
163
163
 
164
164
  5: { // MarkToLigature Attachment Positioning
165
- format: r.uint16,
166
- markCoverage: new r.Pointer(r.uint16, Coverage),
167
- ligatureCoverage: new r.Pointer(r.uint16, Coverage),
168
- classCount: r.uint16,
169
- markArray: new r.Pointer(r.uint16, MarkArray),
170
- ligatureArray: new r.Pointer(r.uint16, LigatureArray)
165
+ format: r.uint16,
166
+ markCoverage: new r.Pointer(r.uint16, Coverage),
167
+ ligatureCoverage: new r.Pointer(r.uint16, Coverage),
168
+ classCount: r.uint16,
169
+ markArray: new r.Pointer(r.uint16, MarkArray),
170
+ ligatureArray: new r.Pointer(r.uint16, LigatureArray)
171
171
  },
172
172
 
173
173
  6: { // MarkToMark Attachment Positioning
174
- format: r.uint16,
175
- mark1Coverage: new r.Pointer(r.uint16, Coverage),
176
- mark2Coverage: new r.Pointer(r.uint16, Coverage),
177
- classCount: r.uint16,
178
- mark1Array: new r.Pointer(r.uint16, MarkArray),
179
- mark2Array: new r.Pointer(r.uint16, BaseArray)
174
+ format: r.uint16,
175
+ mark1Coverage: new r.Pointer(r.uint16, Coverage),
176
+ mark2Coverage: new r.Pointer(r.uint16, Coverage),
177
+ classCount: r.uint16,
178
+ mark1Array: new r.Pointer(r.uint16, MarkArray),
179
+ mark2Array: new r.Pointer(r.uint16, BaseArray)
180
180
  },
181
181
 
182
- 7: Context, // Contextual positioning
183
- 8: ChainingContext, // Chaining contextual positioning
182
+ 7: Context, // Contextual positioning
183
+ 8: ChainingContext, // Chaining contextual positioning
184
184
 
185
185
  9: { // Extension Positioning
186
- posFormat: r.uint16,
187
- lookupType: r.uint16, // cannot also be 9
188
- extension: new r.Pointer(r.uint32, null)
186
+ posFormat: r.uint16,
187
+ lookupType: r.uint16, // cannot also be 9
188
+ extension: new r.Pointer(r.uint32, null)
189
189
  }
190
190
  });
191
191
 
@@ -194,9 +194,9 @@ GPOSLookup.versions[9].extension.type = GPOSLookup;
194
194
 
195
195
  export default new r.VersionedStruct(r.uint32, {
196
196
  header: {
197
- scriptList: new r.Pointer(r.uint16, ScriptList),
198
- featureList: new r.Pointer(r.uint16, FeatureList),
199
- lookupList: new r.Pointer(r.uint16, new LookupList(GPOSLookup))
197
+ scriptList: new r.Pointer(r.uint16, ScriptList),
198
+ featureList: new r.Pointer(r.uint16, FeatureList),
199
+ lookupList: new r.Pointer(r.uint16, new LookupList(GPOSLookup))
200
200
  },
201
201
 
202
202
  0x00010000: {},
@@ -1,70 +1,70 @@
1
1
  import * as r from 'restructure';
2
- import {ScriptList, FeatureList, LookupList, Coverage, Context, ChainingContext} from './opentype';
3
- import {FeatureVariations} from './variations';
2
+ import { ScriptList, FeatureList, LookupList, Coverage, Context, ChainingContext } from './opentype';
3
+ import { FeatureVariations } from './variations';
4
4
 
5
5
  let Sequence = new r.Array(r.uint16, r.uint16);
6
6
  let AlternateSet = Sequence;
7
7
 
8
8
  let Ligature = new r.Struct({
9
- glyph: r.uint16,
10
- compCount: r.uint16,
9
+ glyph: r.uint16,
10
+ compCount: r.uint16,
11
11
  components: new r.Array(r.uint16, t => t.compCount - 1)
12
12
  });
13
13
 
14
14
  let LigatureSet = new r.Array(new r.Pointer(r.uint16, Ligature), r.uint16);
15
15
 
16
16
  let GSUBLookup = new r.VersionedStruct('lookupType', {
17
- 1: new r.VersionedStruct(r.uint16, {// Single Substitution
17
+ 1: new r.VersionedStruct(r.uint16, { // Single Substitution
18
18
  1: {
19
- coverage: new r.Pointer(r.uint16, Coverage),
20
- deltaGlyphID: r.int16
19
+ coverage: new r.Pointer(r.uint16, Coverage),
20
+ deltaGlyphID: r.int16
21
21
  },
22
22
  2: {
23
- coverage: new r.Pointer(r.uint16, Coverage),
24
- glyphCount: r.uint16,
25
- substitute: new r.LazyArray(r.uint16, 'glyphCount')
23
+ coverage: new r.Pointer(r.uint16, Coverage),
24
+ glyphCount: r.uint16,
25
+ substitute: new r.LazyArray(r.uint16, 'glyphCount')
26
26
  }
27
27
  }),
28
28
 
29
29
  2: { // Multiple Substitution
30
- substFormat: r.uint16,
31
- coverage: new r.Pointer(r.uint16, Coverage),
32
- count: r.uint16,
33
- sequences: new r.LazyArray(new r.Pointer(r.uint16, Sequence), 'count')
30
+ substFormat: r.uint16,
31
+ coverage: new r.Pointer(r.uint16, Coverage),
32
+ count: r.uint16,
33
+ sequences: new r.LazyArray(new r.Pointer(r.uint16, Sequence), 'count')
34
34
  },
35
35
 
36
36
  3: { // Alternate Substitution
37
- substFormat: r.uint16,
38
- coverage: new r.Pointer(r.uint16, Coverage),
39
- count: r.uint16,
40
- alternateSet: new r.LazyArray(new r.Pointer(r.uint16, AlternateSet), 'count')
37
+ substFormat: r.uint16,
38
+ coverage: new r.Pointer(r.uint16, Coverage),
39
+ count: r.uint16,
40
+ alternateSet: new r.LazyArray(new r.Pointer(r.uint16, AlternateSet), 'count')
41
41
  },
42
42
 
43
43
  4: { // Ligature Substitution
44
- substFormat: r.uint16,
45
- coverage: new r.Pointer(r.uint16, Coverage),
46
- count: r.uint16,
47
- ligatureSets: new r.LazyArray(new r.Pointer(r.uint16, LigatureSet), 'count')
44
+ substFormat: r.uint16,
45
+ coverage: new r.Pointer(r.uint16, Coverage),
46
+ count: r.uint16,
47
+ ligatureSets: new r.LazyArray(new r.Pointer(r.uint16, LigatureSet), 'count')
48
48
  },
49
49
 
50
- 5: Context, // Contextual Substitution
50
+ 5: Context, // Contextual Substitution
51
51
  6: ChainingContext, // Chaining Contextual Substitution
52
52
 
53
53
  7: { // Extension Substitution
54
- substFormat: r.uint16,
55
- lookupType: r.uint16, // cannot also be 7
56
- extension: new r.Pointer(r.uint32, null)
54
+ substFormat: r.uint16,
55
+ lookupType: r.uint16, // cannot also be 7
56
+ extension: new r.Pointer(r.uint32, null)
57
57
  },
58
58
 
59
59
  8: { // Reverse Chaining Contextual Single Substitution
60
- substFormat: r.uint16,
61
- coverage: new r.Pointer(r.uint16, Coverage),
62
- backtrackGlyphCount: r.uint16,
63
- backtrackCoverage: new r.Array(new r.Pointer(r.uint16, Coverage), 'backtrackGlyphCount'),
64
- lookaheadGlyphCount: r.uint16,
65
- lookaheadCoverage: new r.Array(new r.Pointer(r.uint16, Coverage), 'lookaheadGlyphCount'),
66
- glyphCount: r.uint16,
67
- substitute: new r.LazyArray(r.uint16, 'glyphCount')
60
+ substFormat: r.uint16,
61
+ coverage: new r.Pointer(r.uint16, Coverage),
62
+ backtrackGlyphCount: r.uint16,
63
+ backtrackCoverage: new r.Array(new r.Pointer(r.uint16, Coverage), 'backtrackGlyphCount'),
64
+ lookaheadGlyphCount: r.uint16,
65
+ lookaheadCoverage: new r.Array(new r.Pointer(r.uint16, Coverage), 'lookaheadGlyphCount'),
66
+ glyphCount: r.uint16,
67
+ substitute: new r.LazyArray(r.uint16, 'glyphCount')
68
68
  }
69
69
  });
70
70
 
@@ -73,9 +73,9 @@ GSUBLookup.versions[7].extension.type = GSUBLookup;
73
73
 
74
74
  export default new r.VersionedStruct(r.uint32, {
75
75
  header: {
76
- scriptList: new r.Pointer(r.uint16, ScriptList),
77
- featureList: new r.Pointer(r.uint16, FeatureList),
78
- lookupList: new r.Pointer(r.uint16, new LookupList(GSUBLookup))
76
+ scriptList: new r.Pointer(r.uint16, ScriptList),
77
+ featureList: new r.Pointer(r.uint16, FeatureList),
78
+ lookupList: new r.Pointer(r.uint16, new LookupList(GSUBLookup))
79
79
  },
80
80
 
81
81
  0x00010000: {},
@@ -5,39 +5,39 @@ import { GPOSLookup } from './GPOS';
5
5
  let JstfGSUBModList = new r.Array(r.uint16, r.uint16);
6
6
 
7
7
  let JstfPriority = new r.Struct({
8
- shrinkageEnableGSUB: new r.Pointer(r.uint16, JstfGSUBModList),
9
- shrinkageDisableGSUB: new r.Pointer(r.uint16, JstfGSUBModList),
10
- shrinkageEnableGPOS: new r.Pointer(r.uint16, JstfGSUBModList),
11
- shrinkageDisableGPOS: new r.Pointer(r.uint16, JstfGSUBModList),
12
- shrinkageJstfMax: new r.Pointer(r.uint16, new LookupList(GPOSLookup)),
13
- extensionEnableGSUB: new r.Pointer(r.uint16, JstfGSUBModList),
14
- extensionDisableGSUB: new r.Pointer(r.uint16, JstfGSUBModList),
15
- extensionEnableGPOS: new r.Pointer(r.uint16, JstfGSUBModList),
16
- extensionDisableGPOS: new r.Pointer(r.uint16, JstfGSUBModList),
17
- extensionJstfMax: new r.Pointer(r.uint16, new LookupList(GPOSLookup))
8
+ shrinkageEnableGSUB: new r.Pointer(r.uint16, JstfGSUBModList),
9
+ shrinkageDisableGSUB: new r.Pointer(r.uint16, JstfGSUBModList),
10
+ shrinkageEnableGPOS: new r.Pointer(r.uint16, JstfGSUBModList),
11
+ shrinkageDisableGPOS: new r.Pointer(r.uint16, JstfGSUBModList),
12
+ shrinkageJstfMax: new r.Pointer(r.uint16, new LookupList(GPOSLookup)),
13
+ extensionEnableGSUB: new r.Pointer(r.uint16, JstfGSUBModList),
14
+ extensionDisableGSUB: new r.Pointer(r.uint16, JstfGSUBModList),
15
+ extensionEnableGPOS: new r.Pointer(r.uint16, JstfGSUBModList),
16
+ extensionDisableGPOS: new r.Pointer(r.uint16, JstfGSUBModList),
17
+ extensionJstfMax: new r.Pointer(r.uint16, new LookupList(GPOSLookup))
18
18
  });
19
19
 
20
20
  let JstfLangSys = new r.Array(new r.Pointer(r.uint16, JstfPriority), r.uint16);
21
21
 
22
22
  let JstfLangSysRecord = new r.Struct({
23
- tag: new r.String(4),
23
+ tag: new r.String(4),
24
24
  jstfLangSys: new r.Pointer(r.uint16, JstfLangSys)
25
25
  });
26
26
 
27
27
  let JstfScript = new r.Struct({
28
28
  extenderGlyphs: new r.Pointer(r.uint16, new r.Array(r.uint16, r.uint16)), // array of glyphs to extend line length
29
29
  defaultLangSys: new r.Pointer(r.uint16, JstfLangSys),
30
- langSysCount: r.uint16,
30
+ langSysCount: r.uint16,
31
31
  langSysRecords: new r.Array(JstfLangSysRecord, 'langSysCount')
32
32
  });
33
33
 
34
34
  let JstfScriptRecord = new r.Struct({
35
- tag: new r.String(4),
36
- script: new r.Pointer(r.uint16, JstfScript, {type: 'parent'})
35
+ tag: new r.String(4),
36
+ script: new r.Pointer(r.uint16, JstfScript, { type: 'parent' })
37
37
  });
38
38
 
39
39
  export default new r.Struct({
40
- version: r.uint32, // should be 0x00010000
40
+ version: r.uint32, // should be 0x00010000
41
41
  scriptCount: r.uint16,
42
- scriptList: new r.Array(JstfScriptRecord, 'scriptCount')
42
+ scriptList: new r.Array(JstfScriptRecord, 'scriptCount')
43
43
  });
@@ -4,7 +4,7 @@ import * as r from 'restructure';
4
4
  // Records the ppem for each glyph at which the scaling becomes linear again,
5
5
  // despite instructions effecting the advance width
6
6
  export default new r.Struct({
7
- version: r.uint16,
8
- numGlyphs: r.uint16,
9
- yPels: new r.Array(r.uint8, 'numGlyphs')
7
+ version: r.uint16,
8
+ numGlyphs: r.uint16,
9
+ yPels: new r.Array(r.uint8, 'numGlyphs')
10
10
  });