Browse Source

Get Type3 fonts working again.

Julian Viereck 14 years ago
parent
commit
4e3f0e7463
  1. 13
      pdf.js
  2. 2
      worker.js

13
pdf.js

@ -4687,7 +4687,8 @@ var PartialEvaluator = (function partialEvaluator() {
var font = xref.fetchIfRef(fontRes.get(fontName)); var font = xref.fetchIfRef(fontRes.get(fontName));
assertWellFormed(isDict(font)); assertWellFormed(isDict(font));
if (!font.translated) { if (!font.translated) {
font.translated = self.translateFont(font, xref, resources); font.translated = self.translateFont(font, xref, resources, handler,
uniquePrefix, dependency);
if (font.translated) { if (font.translated) {
// keep track of each font we translated so the caller can // keep track of each font we translated so the caller can
// load them asynchronously before calling display on a page // load them asynchronously before calling display on a page
@ -5279,7 +5280,7 @@ var PartialEvaluator = (function partialEvaluator() {
}, },
translateFont: function partialEvaluatorTranslateFont(dict, xref, translateFont: function partialEvaluatorTranslateFont(dict, xref,
resources) { resources, queue, handler, uniquePrefix, dependency) {
var baseDict = dict; var baseDict = dict;
var type = dict.get('Subtype'); var type = dict.get('Subtype');
assertWellFormed(isName(type), 'invalid font Subtype'); assertWellFormed(isName(type), 'invalid font Subtype');
@ -5424,9 +5425,9 @@ var PartialEvaluator = (function partialEvaluator() {
properties.resources = fontResources; properties.resources = fontResources;
for (var key in charProcs.map) { for (var key in charProcs.map) {
var glyphStream = xref.fetchIfRef(charProcs.map[key]); var glyphStream = xref.fetchIfRef(charProcs.map[key]);
properties.glyphs[key].code = this.evaluate(glyphStream, var queue = {};
xref, properties.glyphs[key].IRQueue = this.getIRQueue(glyphStream,
fontResources); xref, fontResources, queue, handler, uniquePrefix, dependency);
} }
} }
@ -5925,7 +5926,7 @@ var CanvasGraphics = (function canvasGraphics() {
this.save(); this.save();
ctx.scale(fontSize, fontSize); ctx.scale(fontSize, fontSize);
ctx.transform.apply(ctx, fontMatrix); ctx.transform.apply(ctx, fontMatrix);
this.execute(glyph.code, this.xref, font.resources); this.executeIRQueue(glyph.IRQueue);
this.restore(); this.restore();
var transformed = Util.applyTransform([glyph.width, 0], fontMatrix); var transformed = Util.applyTransform([glyph.width, 0], fontMatrix);

2
worker.js

@ -4,7 +4,7 @@
'use strict'; 'use strict';
// Set this to true if you want to use workers. // Set this to true if you want to use workers.
var useWorker = true; var useWorker = false;
var WorkerPage = (function() { var WorkerPage = (function() {
function constructor(workerPDF, page, objs) { function constructor(workerPDF, page, objs) {

Loading…
Cancel
Save