parseWOFFTableEntries top-level property
Parses WOFF table entries. @param {DataView} @param {Number} @return {Object[]}
Implementation
Function parseWOFFTableEntries = (data, numTables) {
var tableEntries = [];
var p = 44; // offset to the first table directory entry.
for (var i = 0; i < numTables; i += 1) {
var tag = getTag(data, p);
var offset = getULong(data, p + 4);
var compLength = getULong(data, p + 8);
var origLength = getULong(data, p + 12);
var compression;
if (compLength < origLength) {
compression = 'WOFF';
} else {
compression = false;
}
tableEntries.add({"tag": tag, "offset": offset, "compression": compression,
"compressedLength": compLength, "length": origLength});
p += 20;
}
return tableEntries;
};