Additional heuristics to recognize unknown glyphs for toUnicode (bug 1027533) #4980
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the introduction of
adjustMapping
in PR #4259, for certain fonts we are now a lot more dependent on the existence (and correctness) oftoUnicode
; see e.g. fonts.js#L2479.For the PDF file referenced in the bug, the
toUnicode
entries are of the formg00xx
, 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.