From: Chris Jones Date: Wed, 22 Jun 2011 08:50:43 +0000 (-0700) Subject: deal with apparent lack of FontDescriptor for standard fonts X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=5dc54559596220cfb0bd05de2fdfab2913b573b5;p=pdf.js.git deal with apparent lack of FontDescriptor for standard fonts --- diff --git a/pdf.js b/pdf.js index dc0f701..19fa125 100644 --- a/pdf.js +++ b/pdf.js @@ -2343,7 +2343,12 @@ var CanvasGraphics = (function() { constructor.prototype = { translateFont: function(fontDict, xref, resources) { - var descriptor = xref.fetch(fontDict.get("FontDescriptor")); + var fd = fontDict.get("FontDescriptor"); + if (!fd) + // XXX deprecated "special treatment" for standard + // fonts? What do we need to do here? + return; + var descriptor = xref.fetch(fd); var fontName = descriptor.get("FontName"); assertWellFormed(IsName(fontName), "invalid font name"); diff --git a/test.py b/test.py index a7be3df..0c326ec 100644 --- a/test.py +++ b/test.py @@ -287,9 +287,10 @@ def processResults(): def main(args): masterMode = False + manifestFile = DEFAULT_MANIFEST_FILE if len(args) == 1: masterMode = (args[0] == '-m') - manifestFile = args[0] if not masterMode else DEFAULT_MANIFEST_FILE + manifestFile = args[0] if not masterMode else manifestFile setUp(manifestFile, masterMode)