MCPcopy Create free account
hub / github.com/Code-Bullet/Jump-King / makeFvarTable

Function makeFvarTable

libraries/p5.js:4284–4312  ·  view source on GitHub ↗
(fvar, names)

Source from the content-addressed store, hash-verified

4282}
4283
4284function makeFvarTable(fvar, names) {
4285 var result = new table.Table('fvar', [
4286 {name: 'version', type: 'ULONG', value: 0x10000},
4287 {name: 'offsetToData', type: 'USHORT', value: 0},
4288 {name: 'countSizePairs', type: 'USHORT', value: 2},
4289 {name: 'axisCount', type: 'USHORT', value: fvar.axes.length},
4290 {name: 'axisSize', type: 'USHORT', value: 20},
4291 {name: 'instanceCount', type: 'USHORT', value: fvar.instances.length},
4292 {name: 'instanceSize', type: 'USHORT', value: 4 + fvar.axes.length * 4}
4293 ]);
4294 result.offsetToData = result.sizeOf();
4295
4296 for (var i = 0; i < fvar.axes.length; i++) {
4297 result.fields.push({
4298 name: 'axis ' + i,
4299 type: 'TABLE',
4300 value: makeFvarAxis(fvar.axes[i], names)});
4301 }
4302
4303 for (var j = 0; j < fvar.instances.length; j++) {
4304 result.fields.push({
4305 name: 'instance ' + j,
4306 type: 'TABLE',
4307 value: makeFvarInstance(fvar.instances[j], fvar.axes, names)
4308 });
4309 }
4310
4311 return result;
4312}
4313
4314function parseFvarTable(data, start, names) {
4315 var p = new parse.Parser(data, start);

Callers

nothing calls this directly

Calls 2

makeFvarAxisFunction · 0.85
makeFvarInstanceFunction · 0.85

Tested by

no test coverage detected