Merge pull request #1406 from 'bdahl/string_fontname'
Fix string font names.
This commit is contained in:
commit
19bc96a617
@ -805,6 +805,9 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||||||
var firstChar = xref.fetchIfRef(dict.get('FirstChar')) || 0;
|
var firstChar = xref.fetchIfRef(dict.get('FirstChar')) || 0;
|
||||||
var lastChar = xref.fetchIfRef(dict.get('LastChar')) || maxCharIndex;
|
var lastChar = xref.fetchIfRef(dict.get('LastChar')) || maxCharIndex;
|
||||||
var fontName = xref.fetchIfRef(descriptor.get('FontName'));
|
var fontName = xref.fetchIfRef(descriptor.get('FontName'));
|
||||||
|
// Some bad pdf's have a string as the font name.
|
||||||
|
if (isString(fontName))
|
||||||
|
fontName = new Name(fontName);
|
||||||
assertWellFormed(isName(fontName), 'invalid font name');
|
assertWellFormed(isName(fontName), 'invalid font name');
|
||||||
|
|
||||||
var fontFile = descriptor.get('FontFile', 'FontFile2', 'FontFile3');
|
var fontFile = descriptor.get('FontFile', 'FontFile2', 'FontFile3');
|
||||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -25,6 +25,7 @@
|
|||||||
!issue1249.pdf
|
!issue1249.pdf
|
||||||
!smaskdim.pdf
|
!smaskdim.pdf
|
||||||
!type4psfunc.pdf
|
!type4psfunc.pdf
|
||||||
|
!issue1350.pdf
|
||||||
!S2.pdf
|
!S2.pdf
|
||||||
!zerowidthline.pdf
|
!zerowidthline.pdf
|
||||||
!issue1002.pdf
|
!issue1002.pdf
|
||||||
|
2184
test/pdfs/issue1350.pdf
Normal file
2184
test/pdfs/issue1350.pdf
Normal file
File diff suppressed because one or more lines are too long
@ -488,6 +488,12 @@
|
|||||||
"link": true,
|
"link": true,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{ "id": "issue1350",
|
||||||
|
"file": "pdfs/issue1350.pdf",
|
||||||
|
"md5": "92f72a04a4d9d05b2dd433b51f32ab1f",
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{ "id": "issue925",
|
{ "id": "issue925",
|
||||||
"file": "pdfs/issue925.pdf",
|
"file": "pdfs/issue925.pdf",
|
||||||
"md5": "f58fe943090aff89dcc8e771bc0db4c2",
|
"md5": "f58fe943090aff89dcc8e771bc0db4c2",
|
||||||
|
Loading…
Reference in New Issue
Block a user