Only use base encoding if it's populated. (bug 1727053)

The font dict in this file has an encoding entry, but only specifies a
differences map. The base encoding is empty in this case and shouldn't
be used.
This commit is contained in:
Brendan Dahl 2021-08-30 12:51:59 -07:00
parent 306119b12a
commit a7f807b059
4 changed files with 8 additions and 1 deletions

View File

@ -2629,7 +2629,7 @@ class Font {
let glyphName; let glyphName;
if (this.differences[charCode] !== undefined) { if (this.differences[charCode] !== undefined) {
glyphName = this.differences[charCode]; glyphName = this.differences[charCode];
} else if (baseEncoding[charCode] !== "") { } else if (baseEncoding.length && baseEncoding[charCode] !== "") {
glyphName = baseEncoding[charCode]; glyphName = baseEncoding[charCode];
} else { } else {
glyphName = StandardEncoding[charCode]; glyphName = StandardEncoding[charCode];

View File

@ -12,6 +12,7 @@
!xref_command_missing.pdf !xref_command_missing.pdf
!issue1155r.pdf !issue1155r.pdf
!issue2017r.pdf !issue2017r.pdf
!bug1727053.pdf
!issue2391-1.pdf !issue2391-1.pdf
!issue2391-2.pdf !issue2391-2.pdf
!issue3214.pdf !issue3214.pdf

BIN
test/pdfs/bug1727053.pdf Normal file

Binary file not shown.

View File

@ -242,6 +242,12 @@
"lastPage": 4, "lastPage": 4,
"type": "eq" "type": "eq"
}, },
{ "id": "bug1727053",
"file": "pdfs/bug1727053.pdf",
"md5": "8ed1e52da64000f9fdcb8b732f5a58f8",
"rounds": 1,
"type": "eq"
},
{ "id": "issue3999", { "id": "issue3999",
"file": "pdfs/issue3999.pdf", "file": "pdfs/issue3999.pdf",
"md5": "0a59cd612e93758aa9f104470f45574b", "md5": "0a59cd612e93758aa9f104470f45574b",