PDF files:
[1.pdf](https://github.com/mozilla/pdf.js/files/2955999/1.pdf)
[2.pdf](https://github.com/mozilla/pdf.js/files/2956000/2.pdf)
[3.pdf](https://github.com/mozilla/pdf.js/files/2956002/3.pdf)

Configuration:
- Web browser and its version: Chrome, Firefox
- Operating system and its version: Ubuntu, macOS
- PDF.js version: 2.2.42, but the same was with 2.1.x, and with https://mozilla.github.io/pdf.js/web/viewer.html
- Is a browser extension: no

Steps to reproduce the problem:
1. Select text
2. Copy text

What went wrong?

Getting this:
`OpenSansisahumanistsansseriftypefacedesignedbySteveMatteson.OpenSanswasdesignedwithanuprightstress,openformsandaneu-tral,yetfriendlyappearance.Itwasoptimizedforprint,web,andmobileinterfaces,andhasexcellentlegibilitycharacteristicsinitsletterforms(seefigureonthefollowingpage).ThisfontisavailablefromtheGoogleFontDirectory[]asTrueTypefileslicensedundertheApacheLicenseversion..`

Instead of this:
`Open Sans is a humanist sans serif typeface designed by Steve Matteson.
Open Sans was designed with an upright stress, open forms and a neutral,
yet friendly appearance. It was optimized for print, web, and mobile
interfaces, and has excellent legibility characteristics in its letterforms (see
figure 1 on the following page). This font is available from the Google Font
Directory [1] as TrueType files licensed under the Apache License version 2.0.`

This is quite significant problem, because I would say 1/20 of scientific papers encounter this problem.

Util,
} from "../shared/util.js";
/**
 * Text layer render parameters.
 *
 * @typedef {Object} TextLayerRenderParameters
 * @property {import("./api").TextContent} [textContent] - Text content to
 *   render (the object is returned by the page's `getTextContent` method).
 * @property {ReadableStream} [textContentStream] - Text content stream to
 *   render (the stream is returned by the page's `streamTextContent` method).
 * @property {HTMLElement} container - HTML element that will contain text runs.
 * @property {import("./display_utils").PageViewport} viewport - The target
 *   viewport to properly layout the text runs.
 * @property {Array<HTMLElement>} [textDivs] - HTML elements that are correspond
 *   to the text items of the textContent input. This is output and shall be
 *   initially be set to empty array.
 * @property {Array<string>} [textContentItemsStr] - Strings that correspond to
 *    the `str` property of the text items of textContent input. This is output
 *   and shall be initially be set to empty array.
 * @property {number} [timeout] - Delay in milliseconds before rendering of the
 *   text runs occurs.
 * @property {boolean} [enhanceTextSelection] - Whether to turn on the text
 *   selection enhancement.
 */
const MAX_TEXT_DIVS_TO_RENDER = 100000;
const DEFAULT_FONT_SIZE = 30;
const DEFAULT_FONT_ASCENT = 0.8;
const ascentCache = new Map();
const AllWhitespaceRegexp = /^\s+$/g;
function getAscent(fontFamily, ctx) {