]> git.parisson.com Git - pdf.js.git/commitdiff
Restore font lookup and setting
authorChris Jones <jones.chris.g@gmail.com>
Mon, 9 May 2011 20:18:19 +0000 (15:18 -0500)
committerChris Jones <jones.chris.g@gmail.com>
Mon, 9 May 2011 20:18:19 +0000 (15:18 -0500)
pdf.js

diff --git a/pdf.js b/pdf.js
index ad02f301e4b31b77d116059f086eacb9e23d6515..287ccd2638452927320d8b14bf1b0530e1cf6954 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -984,6 +984,7 @@ var Interpreter = (function() {
         this.res = resources;
         this.catalog = catalog;
         this.gfx = gfx;
+        var env = this;
         this.map = {
             // Graphics state
             w: gfx.setLineWidth,
@@ -1008,7 +1009,10 @@ var Interpreter = (function() {
             // Text
             BT: gfx.beginText,
             ET: gfx.endText,
-            Tf: gfx.setFont,
+            Tf: function(fontRef, size) {
+                var font = env.res.Font[fontRef.name]
+                gfx.setFont(font, size);
+            },
             Td: gfx.moveText,
             Tj: gfx.showText,