From: Chris Jones Date: Thu, 5 May 2011 01:08:52 +0000 (-0500) Subject: Dumb text WIP, more UI for test.html X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=198a3f1a1bc8befcce23077725e0e9803b962c89;p=pdf.js.git Dumb text WIP, more UI for test.html --- diff --git a/pdf.js b/pdf.js index 7fcd972..a017226 100644 --- a/pdf.js +++ b/pdf.js @@ -817,8 +817,8 @@ var EchoGraphics = (function() { this.dedent(); this.printdentln("ET"); }, - setFont: function(font, sizePt) { - this.printdentln("/"+ font +" "+ sizePt +" Tf"); + setFont: function(font, size) { + this.printdentln("/"+ font +" "+ size +" Tf"); }, moveText: function (x, y) { this.printdentln(""+ x +" "+ y +" Td"); @@ -963,7 +963,25 @@ var CanvasGraphics = (function() { }, // Clipping + // Text + beginText: function() { + + }, + endText: function() { + + }, + setFont: function(font, size) { + // NYI + this.ctx.font = size +'px Helvetica'; + }, + moveText: function (x, y) { + this.moveTo(x, y); + }, + showText: function(text) { + this.ctx.fillText(text, 100, 100); + }, + // Type3 fonts // Color @@ -1001,7 +1019,7 @@ try { var MockParser = (function() { function constructor(objs) { - this.objs = objs; + this.objs = objs.slice(0); } constructor.prototype = { diff --git a/test.html b/test.html index 09d677f..22e9101 100644 --- a/test.html +++ b/test.html @@ -13,27 +13,44 @@
- + - +