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.

}
    width = width || this.defaultWidth;
    return shadow(this, "spaceWidth", width);
  }
  /**
   * @private
   */
  _charToGlyph(charcode, isSpace = false) {
    let fontCharCode, width, operatorListId;
    let widthCode = charcode;
    if (this.cMap && this.cMap.contains(charcode)) {
      widthCode = this.cMap.lookup(charcode);
    }
    width = this.widths[widthCode];
    width = isNum(width) ? width : this.defaultWidth;
    const vmetric = this.vmetrics && this.vmetrics[widthCode];
    let unicode = this.toUnicode.get(charcode) || charcode;
    if (typeof unicode === "number") {
      unicode = String.fromCharCode(unicode);
    }
    let isInFont = this.toFontChar[charcode] !== undefined;
    
    
    fontCharCode = this.toFontChar[charcode] || charcode;
    if (this.missingFile) {
      const glyphName =
        this.differences[charcode] || this.defaultEncoding[charcode];
      if (
        (glyphName === ".notdef" || glyphName === "") &&
        this.type === "Type1"