From c03dd980752c71b22961c80d59142099d0d487a9 Mon Sep 17 00:00:00 2001
From: Vivien Nicolas <21@vingtetun.org>
Date: Mon, 13 Jun 2011 23:23:13 +0200
Subject: [PATCH] Do not use makeSubStream in the CFF constructor

---
 PDFFont.js | 6 +++---
 pdf.js     | 1 -
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/PDFFont.js b/PDFFont.js
index 9318fd3a1..34fb28fc4 100644
--- a/PDFFont.js
+++ b/PDFFont.js
@@ -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 a9c9bf020..8b06f5582 100644
--- 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) {