diff --git a/pdf.js b/pdf.js index 46f946c40..1a586e48a 100644 --- a/pdf.js +++ b/pdf.js @@ -55,11 +55,17 @@ function backtrace() { } function shadow(obj, prop, value) { - Object.defineProperty(obj, prop, { value: value, - enumerable: true, - configurable: true, - writable: false }); - return value; + try { + Object.defineProperty(obj, prop, { value: value, + enumerable: true, + configurable: true, + writable: false }); + } catch(e) { + obj.__defineGetter__(prop, function() { + return value; + }); + } + return value; } function bytesToString(bytes) { @@ -4275,6 +4281,10 @@ var PartialEvaluator = (function() { case 'Type1': baseEncoding = Encodings.StandardEncoding.slice(); break; + case 'Type3': + // There is no baseEncoding for a Type3 font, the 'Encoding' + // entry is required and should provide a complete encoding + break; default: warn('Unknown type of font: ' + fontType); break; @@ -4298,6 +4308,10 @@ var PartialEvaluator = (function() { glyphsMap[glyph] = encodingMap[i] = GlyphsUnicode[glyph] || i; } + + if (fontType == 'Type3') + log(glyphsMap); + if (fontType == 'TrueType' && fontDict.has('ToUnicode') && differences) { var cmapObj = xref.fetchIfRef(fontDict.get('ToUnicode')); if (IsName(cmapObj)) {