]> git.parisson.com Git - pdf.js.git/commitdiff
Turn on TrueType decoder even if the sanitizer prevent them to load at the moment
authorVivien Nicolas <21@vingtetun.org>
Sun, 12 Jun 2011 01:10:54 +0000 (03:10 +0200)
committerVivien Nicolas <21@vingtetun.org>
Sun, 12 Jun 2011 01:10:54 +0000 (03:10 +0200)
PDFFont.js
pdf.js

index 1da594e28a000669eda1628ffcc1db40d838090a..fa4faabdd908c3e03e29b0112f76a33d26b75190 100644 (file)
@@ -60,7 +60,7 @@ var Base64Encoder = {
     var str = [];
     var count = aData.length;
     for (var i = 0; i < count; i++)
-      str.push(aData.getChar ? aData.getChar : String.fromCharCode(aData[i]));
+      str.push(aData.getChar ? aData.getChar() : String.fromCharCode(aData[i]));
 
     return window.btoa(str.join(""));
   }
@@ -71,7 +71,7 @@ var TrueTypeFont = function(aFontName, aFontFile) {
     return;
   _Fonts[aFontName] = true;
 
-  var debug = false;
+  var debug = true;
   function dump(aMsg) {
     if (debug)
       log(aMsg);
diff --git a/pdf.js b/pdf.js
index 7bc788e204035d7aee3e464cb7d561e4d7caeb85..cdc035c28f5cd8d5250853c3d43e5a1def93cc66 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -2286,6 +2286,7 @@ var CanvasGraphics = (function() {
                   var fontDescriptor = this.xref.fetchIfRef(fontDescriptor);
                   var fontFile = this.xref.fetchIfRef(fontDescriptor.get("FontFile"));
                   fontName = fontDescriptor.get("FontName").name;
+                  fontName = fontName.replace("+", ""); // no + are allowed in the font name
                   font = new Type1Font(fontName, fontFile);
                 }
                 break;
@@ -2295,7 +2296,6 @@ var CanvasGraphics = (function() {
                 break;
 
               case "TrueType":
-                break;
                 var fontDescriptor = font.get("FontDescriptor");
                 if (fontDescriptor.num) {
                   var fontDescriptor = this.xref.fetchIfRef(fontDescriptor);