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

Function parseCoverageTable

libraries/p5.js:4671–4691  ·  view source on GitHub ↗
(data, start)

Source from the content-addressed store, hash-verified

4669// Format 1 is a simple list of glyph ids,
4670// Format 2 is a list of ranges. It is expanded in a list of glyphs, maybe not the best idea.
4671function parseCoverageTable(data, start) {
4672 var p = new parse.Parser(data, start);
4673 var format = p.parseUShort();
4674 var count = p.parseUShort();
4675 if (format === 1) {
4676 return p.parseUShortList(count);
4677 }
4678 else if (format === 2) {
4679 var coverage = [];
4680 for (; count--;) {
4681 var begin = p.parseUShort();
4682 var end = p.parseUShort();
4683 var index = p.parseUShort();
4684 for (var i = begin; i <= end; i++) {
4685 coverage[index++] = i;
4686 }
4687 }
4688
4689 return coverage;
4690 }
4691}
4692
4693// Parse a Class Definition Table in a GSUB, GPOS or GDEF table.
4694// Returns a function that gets a class value from a glyph ID.

Callers 1

parsePairPosSubTableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected