From 4e3f0e7463869815dbad922406be7d39d8a1f5fd Mon Sep 17 00:00:00 2001 From: Julian Viereck Date: Sat, 8 Oct 2011 22:35:35 +0200 Subject: [PATCH] Get Type3 fonts working again. --- pdf.js | 13 +++++++------ worker.js | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pdf.js b/pdf.js index 2e4edef69..f016ff442 100644 --- a/pdf.js +++ b/pdf.js @@ -4687,7 +4687,8 @@ var PartialEvaluator = (function partialEvaluator() { var font = xref.fetchIfRef(fontRes.get(fontName)); assertWellFormed(isDict(font)); if (!font.translated) { - font.translated = self.translateFont(font, xref, resources); + font.translated = self.translateFont(font, xref, resources, handler, + uniquePrefix, dependency); if (font.translated) { // keep track of each font we translated so the caller can // load them asynchronously before calling display on a page @@ -5279,7 +5280,7 @@ var PartialEvaluator = (function partialEvaluator() { }, translateFont: function partialEvaluatorTranslateFont(dict, xref, - resources) { + resources, queue, handler, uniquePrefix, dependency) { var baseDict = dict; var type = dict.get('Subtype'); assertWellFormed(isName(type), 'invalid font Subtype'); @@ -5424,9 +5425,9 @@ var PartialEvaluator = (function partialEvaluator() { properties.resources = fontResources; for (var key in charProcs.map) { var glyphStream = xref.fetchIfRef(charProcs.map[key]); - properties.glyphs[key].code = this.evaluate(glyphStream, - xref, - fontResources); + var queue = {}; + properties.glyphs[key].IRQueue = this.getIRQueue(glyphStream, + xref, fontResources, queue, handler, uniquePrefix, dependency); } } @@ -5925,7 +5926,7 @@ var CanvasGraphics = (function canvasGraphics() { this.save(); ctx.scale(fontSize, fontSize); ctx.transform.apply(ctx, fontMatrix); - this.execute(glyph.code, this.xref, font.resources); + this.executeIRQueue(glyph.IRQueue); this.restore(); var transformed = Util.applyTransform([glyph.width, 0], fontMatrix); diff --git a/worker.js b/worker.js index e81acf271..9aaf29410 100644 --- a/worker.js +++ b/worker.js @@ -4,7 +4,7 @@ 'use strict'; // Set this to true if you want to use workers. -var useWorker = true; +var useWorker = false; var WorkerPage = (function() { function constructor(workerPDF, page, objs) {