pdf.js/test
Jonas Jenwald 3ccf277f58 Fallback to the /ToUnicode map for TrueType fonts with (3, 1) and (1, 0) cmap-tables (issue 13316)
In the PDF document some of the glyphs have bogus `differences`-entries[1] that cannot be resolved to valid glyph names, thus causing the glyph mapping to fail.
My initial idea was to use a similar approach as in the `PartialEvaluator._simpleFontToUnicode`-method, to extract the charCodes from those entries, however it turned out that that didn't actually help in this case (the mapping was still wrong).

To fix this I'm thus proposing that we fallback to the /ToUnicode map when no other useable data exists (e.g. no post-table), since it *hopefully* shouldn't make things any worse than leaving parts of the glyph map empty (which currently happens).

---
[1] As can be seem below, some of the entries are completely normal while others are non-standard:
```
Differences (array)
    0 = 65
    1 = /g5167
    2 = /space
    3 = /g11927
    4 = /g17737
    5 = /g11540
    6 = /g2180
    7 = /K
    8 = /P
    9 = /two
    10 = /zero
    11 = /one
    12 = /five
    13 = /four
    14 = /g6932
    15 = /g7246
    16 = /g1691
    17 = /g2343
    18 = /g14792
    19 = /g3325
    20 = /g4280
    21 = /g20383
    22 = /g18166
    23 = /g16988
    24 = /g17943
    25 = /g19223
    26 = /g10830
    27 = 97
    28 = /g982
    29 = /g1226
    30 = /g5059
    31 = /g2677
    32 = /g1042
    33 = /g11568
    34 = /L
    35 = /three
    36 = /seven
    37 = /g2364
    38 = /g12063
    39 = /g5356
    40 = /g2173
    41 = /g17877
    42 = /g7273
    43 = /g7647
    44 = /g7224
    45 = /g19327
    46 = /g5054
    47 = /g2342
    48 = /g10136
    49 = /g6856
    50 = /g13381
    51 = /g7257
    52 = /g12093
    53 = /g2359
```
2021-09-04 07:38:22 +02:00
..
chromium Enable the ESLint no-var rule globally 2021-03-13 16:12:53 +01:00
font Add non-PRODUCTION/TESTING overflow asserts to various string helper-functions (issue 6759) 2021-06-27 16:06:30 +02:00
integration XFA - Support text search in XFA documents. 2021-08-23 08:44:20 -07:00
pdfs Fallback to the /ToUnicode map for TrueType fonts with (3, 1) and (1, 0) cmap-tables (issue 13316) 2021-09-04 07:38:22 +02:00
resources Fix the global variable definitions in test/resources/reftest-analyzer.js (issue 13862) 2021-08-06 11:45:55 +02:00
stats Enable the ESLint no-var rule in the test/stats/ folder 2021-03-14 10:15:45 +01:00
ttx Update fonttools location and version (issue 6223) 2015-07-17 12:51:09 +02:00
types Fix Viewer API definitions and include in CI 2021-08-25 18:45:46 -04:00
unit Merge pull request #13966 from calixteman/no_ns 2021-09-03 09:59:40 -07:00
.eslintrc Enable ESLint rules that no longer need to be disabled on a directory/file-basis 2021-01-22 17:47:03 +01:00
.gitignore Ignore test snapshots directory. 2013-03-15 11:24:08 -07:00
add_test.js Enable the ESLint no-var rule in test/add_test.js 2021-03-14 10:25:51 +01:00
annotation_layer_builder_overrides.css Enable the Stylelint length-zero-no-unit rule 2021-01-10 14:09:36 +01:00
downloadutils.js Drop obsolete logic from the downloadFile function in test/downloadutils.js 2021-05-22 14:45:42 +02:00
driver.js Add support for specifying non-default Optional Content in the ref-tests 2021-08-26 16:54:16 +02:00
integration-boot.js Fix position of highlighted all text. (#13306) 2021-04-28 10:15:31 +02:00
test_manifest.json Fallback to the /ToUnicode map for TrueType fonts with (3, 1) and (1, 0) cmap-tables (issue 13316) 2021-09-04 07:38:22 +02:00
test_slave.html Use the SimpleLinkService when running "annotations" reference tests 2017-09-12 15:24:46 +02:00
test.js Add a special gulp xfatest command, to limit the ref-tests to only XFA-documents (issue 13744) 2021-08-03 23:41:10 +02:00
testutils.js Enable the ESLint no-var rule globally 2021-03-13 16:12:53 +01:00
text_layer_test.css Fix highlighting of search results when the textLayer contains br-elements (PR 13257 follow-up, issue 13323) 2021-05-02 15:36:01 +02:00
webserver.js Remove the LGTM configuration and inline disable comments (issue 13829) 2021-08-03 11:14:49 +02:00