Refactors loadFont for translateFont be async; fixes type3 dup data

This commit is contained in:
Yury Delendik 2014-05-19 16:27:54 -05:00
parent 7079992d89
commit e5a0d89da9
4 changed files with 124 additions and 88 deletions

View file

@ -1196,7 +1196,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
this.current.font = fontObj;
this.current.fontSize = size;
if (fontObj.coded) {
if (fontObj.isType3Font) {
return; // we don't need ctx.font for Type3 fonts
}
@ -1343,7 +1343,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
}
// Type3 fonts - each glyph is a "mini-PDF"
if (font.coded) {
if (font.isType3Font) {
ctx.save();
ctx.transform.apply(ctx, current.textMatrix);
ctx.translate(current.x, current.y);
@ -1363,7 +1363,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
this.save();
ctx.scale(fontSize, fontSize);
ctx.transform.apply(ctx, fontMatrix);
this.executeOperatorList(glyph.operatorList);
var operatorList = font.charProcOperatorList[glyph.operatorListId];
this.executeOperatorList(operatorList);
this.restore();
var transformed = Util.applyTransform([glyph.width, 0], fontMatrix);