]> git.parisson.com Git - pdf.js.git/commitdiff
Do not use makeSubStream in the CFF constructor
authorVivien Nicolas <21@vingtetun.org>
Mon, 13 Jun 2011 21:23:13 +0000 (23:23 +0200)
committerVivien Nicolas <21@vingtetun.org>
Mon, 13 Jun 2011 21:23:13 +0000 (23:23 +0200)
PDFFont.js
pdf.js

index 9318fd3a14c50b0b50cfaaf5cf767483ead2f546..34fb28fc4020f91ae397d4c0116f010db78c0a04 100644 (file)
@@ -1142,9 +1142,9 @@ var CFF = function(aFontName, aFontFile) {
 
   var length1 = aFontFile.dict.get("Length1");
   var length2 = aFontFile.dict.get("Length2");
-  var pos = aFontFile.pos;
-  var ASCIIStream = aFontFile.makeSubStream(pos, length1, aFontFile.dict);
-  var binaryStream = aFontFile.makeSubStream(pos + length1, length2, aFontFile.dict);
+
+  var ASCIIStream = new Stream(aFontFile.getBytes(length1));
+  var binaryStream = new Stream(aFontFile.getBytes(length2));
 
   this.parser = new Type1Parser(ASCIIStream, binaryStream);
   var fontName = this.parser.parse();
diff --git a/pdf.js b/pdf.js
index a9c9bf020961b1ce3e423e6e0f9e9b4151a7dbc3..8b06f5582db8e53c182a551e42173c571162e743 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -1848,7 +1848,6 @@ var CanvasGraphics = (function() {
             }
 
             this.current.fontSize = size;
-            TODO("using hard-coded font for testing");
             this.ctx.font = this.current.fontSize +'px "' + fontName + '"';
         },
         moveText: function (x, y) {