
Attach (recommended) or Link to PDF file here:
[NAPEN16171380959.pdf](https://github.com/mozilla/pdf.js/files/6143802/NAPEN16171380959.pdf)

Configuration:
- Web browser and its version: Firefox 88 Nightly
- Operating system and its version: Windows 10
- PDF.js version:
- Is a browser extension: No

What went wrong? (add screenshot)
![](https://user-media-prod-cdn.itsre-sumo.mozilla.net/uploads/images/2021-03-15-10-58-27-ce2796.png)


}
    
    
    if (codes.length === 0) {
      codes.push({ fontCharCode: 0, glyphId: 0 });
    }
    codes.sort(function fontGetRangesSort(a, b) {
      return a.fontCharCode - b.fontCharCode;
    });
    
    var ranges = [];
    var length = codes.length;
    for (var n = 0; n < length; ) {
      var start = codes[n].fontCharCode;
      var codeIndices = [codes[n].glyphId];
      ++n;
      var end = start;
      while (n < length && end + 1 === codes[n].fontCharCode) {
        codeIndices.push(codes[n].glyphId);
        ++end;
        ++n;
        if (end === 0xffff) {
          break;
        }
      }
      ranges.push([start, end, codeIndices]);
    }
    return ranges;
  }
  function createCmapTable(glyphs, numGlyphs) {