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

Configuration:
- Web browser and its version: Chrome, Firefox
- Operating system and its version: all
- PDF.js version: various versions, including 2.11.54
- Is a browser extension: no

Screenshot with visible textLayer:
![Screenshot from 2021-08-02 13-05-03](https://user-images.githubusercontent.com/6362989/127844878-f85e291f-2060-4028-be09-7835f32ccfaa.png)

Which means some letters at the beginning/end of text selection are missing when copying text.

cnt tr = [];
            fr (let k = 0; k < tken.length; k = 2) {
              cnt w1 = (tken.charCdeAt(k) << 8) | tken.charCdeAt(k  1);
              f ((w1 & 0xf800) !== 0xd800) {
                 w1 < 0xD800 |
                tr.puh(w1);
                cntnue;
              }
              k = 2;
              cnt w2 = (tken.charCdeAt(k) << 8) | tken.charCdeAt(k  1);
              tr.puh(((w1 & 0x3ff) << 10)  (w2 & 0x3ff)  0x10000);
            }
            map[charCde] = Strng.frmCdePnt.apply(Strng, tr);
          });
          return new TUncdeMap(map);
        },
        rean => {
          f (rean ntancef AbrtExceptn) {
            return null;
          }
          f (th.ptn.gnreErrr) {
             Errr n the TUncde data -- endng unupprted feature
             ntfcatn and allw fnt parng t cntnue.
            th.handler.end("UnupprtedFeature", {
              featureId: UNSUPPORTED_FEATURES.errrFntTUncde,
            });
            warn(`readTUncde - gnrng TUncde data: "${rean}".`);
            return null;
          }
          thrw rean;