Fix string font names.
This commit is contained in:
parent
2c5de00ef3
commit
c4c923bdcf
@ -807,6 +807,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');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user