Merge branch 'master' of https://github.com/andreasgal/pdf.js
This commit is contained in:
commit
ce17e9481f
11 changed files with 165 additions and 112 deletions
12
pdf.js
12
pdf.js
|
@ -3811,23 +3811,21 @@ var CanvasGraphics = (function() {
|
|||
if (fontDescriptor && fontDescriptor.num) {
|
||||
var fontDescriptor = this.xref.fetchIfRef(fontDescriptor);
|
||||
fontName = fontDescriptor.get("FontName").name.replace("+", "_");
|
||||
Fonts.setActive(fontName, size);
|
||||
}
|
||||
|
||||
if (!fontName) {
|
||||
// TODO: fontDescriptor is not available, fallback to default font
|
||||
this.current.fontSize = size;
|
||||
this.ctx.font = this.current.fontSize + 'px sans-serif';
|
||||
Fonts.setActive("sans-serif", this.current.fontSize);
|
||||
return;
|
||||
fontName = "sans-serif";
|
||||
}
|
||||
|
||||
this.current.fontName = fontName;
|
||||
this.current.fontSize = size;
|
||||
|
||||
this.ctx.font = this.current.fontSize + 'px "' + fontName + '"';
|
||||
if (this.ctx.$setFont) {
|
||||
this.ctx.$setFont(fontName);
|
||||
this.ctx.$setFont(fontName, size);
|
||||
} else {
|
||||
this.ctx.font = size + 'px "' + fontName + '"';
|
||||
Fonts.setActive(fontName, size);
|
||||
}
|
||||
},
|
||||
setTextRenderingMode: function(mode) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue