1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 07:08:08 +02:00

Fix string font names.

This commit is contained in:
Brendan Dahl 2012-03-16 11:58:23 -07:00
parent 2c5de00ef3
commit c4c923bdcf

View file

@ -807,6 +807,9 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var firstChar = xref.fetchIfRef(dict.get('FirstChar')) || 0;
var lastChar = xref.fetchIfRef(dict.get('LastChar')) || maxCharIndex;
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');
var fontFile = descriptor.get('FontFile', 'FontFile2', 'FontFile3');