mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Refactors loadFont for translateFont be async; fixes type3 dup data
This commit is contained in:
parent
7079992d89
commit
e5a0d89da9
4 changed files with 124 additions and 88 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue