1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-29 07:37:57 +02:00

removed Fonts class

This commit is contained in:
sbarman 2011-07-20 16:42:51 -07:00
parent 3d24b591dc
commit 8d09c0d7a4
2 changed files with 36 additions and 47 deletions

9
pdf.js
View file

@ -2982,7 +2982,7 @@ var Page = (function() {
this.compile(gfx, fonts);
stats.compile = Date.now();
FontLoader.bind(
var fontObjs = FontLoader.bind(
fonts,
function() {
stats.fonts = Date.now();
@ -2999,6 +2999,9 @@ var Page = (function() {
continuation(exc);
});
});
for (var i = 0, ii = fonts.length; i < ii; ++i)
fonts[i].fontDict.fontObj = fontObjs[i];
},
@ -4093,7 +4096,7 @@ var CanvasGraphics = (function() {
this.ctx.$setFont(fontName, size);
} else {
this.ctx.font = size + 'px "' + fontName + '"';
Fonts.setActive(fontName, fontObj, size);
FontMeasure.setActive(fontObj, size);
}
},
setTextRenderingMode: function(mode) {
@ -4145,7 +4148,7 @@ var CanvasGraphics = (function() {
text = font.charsToUnicode(text);
}
ctx.fillText(text, 0, 0);
current.x += Fonts.measureText(text);
current.x += FontMeasure.measureText(text);
}
this.ctx.restore();