https://github.com/mozilla/pdf.js/issues/6397#issuecomment-164954332 Would have been a lot easier to find had there been an assertion checking that string16 didn't go out of bounds of the 16bit number.

const namesRecordCount = strings.length * platforms.length;
  let nameTable =
    "\x00\x00" + 
    string16(namesRecordCount) + 
    string16(namesRecordCount * 12 + 6); 
  
  let strOffset = 0;
  for (i = 0, ii = platforms.length; i < ii; i++) {
    const strs = names[i];
    for (j = 0, jj = strs.length; j < jj; j++) {
      str = strs[j];
      const nameRecord =
        platforms[i] + 
        encodings[i] + 
        languages[i] + 
        string16(j) + 
        string16(str.length) +
        string16(strOffset);
      nameTable += nameRecord;
      strOffset += str.length;
    }
  }
  nameTable += strings.join("") + stringsUnicode.join("");
  return nameTable;
}
/**
 * 'Font' is the class the outside world should use, it encapsulate all the font
 * decoding logics whatever type it is (assuming the font type is supported).
 */
class Font {