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

Function parseGposTable

libraries/p5.js:4863–4883  ·  view source on GitHub ↗
(data, start, font)

Source from the content-addressed store, hash-verified

4861// Parse the `GPOS` table which contains, among other things, kerning pairs.
4862// https://www.microsoft.com/typography/OTSPEC/gpos.htm
4863function parseGposTable(data, start, font) {
4864 var p = new parse.Parser(data, start);
4865 var tableVersion = p.parseFixed();
4866 check.argument(tableVersion === 1, 'Unsupported GPOS table version.');
4867
4868 // ScriptList and FeatureList - ignored for now
4869 parseTaggedListTable(data, start + p.parseUShort());
4870 // 'kern' is the feature we are looking for.
4871 parseTaggedListTable(data, start + p.parseUShort());
4872
4873 // LookupList
4874 var lookupListOffset = p.parseUShort();
4875 p.relativeOffset = lookupListOffset;
4876 var lookupCount = p.parseUShort();
4877 var lookupTableOffsets = p.parseOffset16List(lookupCount);
4878 var lookupListAbsoluteOffset = start + lookupListOffset;
4879 for (var i = 0; i < lookupCount; i++) {
4880 var table = parseLookupTable(data, lookupListAbsoluteOffset + lookupTableOffsets[i]);
4881 if (table.lookupType === 2 && !font.getGposKerningValue) font.getGposKerningValue = table.getKerningValue;
4882 }
4883}
4884
4885exports.parse = parseGposTable;
4886

Callers

nothing calls this directly

Calls 2

parseTaggedListTableFunction · 0.85
parseLookupTableFunction · 0.85

Tested by

no test coverage detected