mozilla/pdf.js — pull request #4980 by Snuffleupagus (2014-06-19 21:33:41+00:00)
Title: Additional heuristics to recognize unknown glyphs for toUnicode (bug 1027533)

With the introduction of `adjustMapping` in PR #4259, for certain fonts we are now more dependent on the existence (and correctness) of `toUnicode`; see e.g. [fonts.js#L2479](https://github.com/mozilla/pdf.js/blob/master/src/core/fonts.js#L2479).

For [the PDF file referenced in the bug](http://studioforcreativeinquiry.org/public/warhol_amiga_report_v10.pdf), a `toUnicode` entry might be e.g. `g008f`, so I've simply extended the heuristics to deal with that particular case of bad Unicode data.

*Note:* This patch still doesn't really fix copying. It's now possible to select the text, but you only get junk when copying (however this is also the case in Adobe Reader).

Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1027533.