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

Merge pull request #1406 from 'bdahl/string_fontname'

Fix string font names.
This commit is contained in:
notmasteryet 2012-03-26 21:17:16 -05:00
commit 19bc96a617
4 changed files with 2194 additions and 0 deletions

View file

@ -805,6 +805,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');