From: Vivien Nicolas <21@vingtetun.org> Date: Mon, 13 Jun 2011 21:23:13 +0000 (+0200) Subject: Do not use makeSubStream in the CFF constructor X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=b7449f3bccdbeb5b062b93c414d85daeccc0febb;p=pdf.js.git Do not use makeSubStream in the CFF constructor --- diff --git a/PDFFont.js b/PDFFont.js index 9318fd3..34fb28f 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 a9c9bf0..8b06f55 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) {