mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-24 17:18:07 +02:00
Merge branch 'master' of github.com:andreasgal/pdf.js
This commit is contained in:
commit
3d9f609054
2 changed files with 11 additions and 1 deletions
9
pdf.js
9
pdf.js
|
@ -1561,6 +1561,7 @@ var CanvasExtraState = (function() {
|
|||
this.alphaIsShape = false;
|
||||
this.fontSize = 0.0;
|
||||
this.textMatrix = IDENTITY_MATRIX;
|
||||
this.leading = 0.0;
|
||||
// Current point (in user coordinates)
|
||||
this.x = 0.0;
|
||||
this.y = 0.0;
|
||||
|
@ -1614,9 +1615,11 @@ var CanvasGraphics = (function() {
|
|||
// Text
|
||||
BT: this.beginText,
|
||||
ET: this.endText,
|
||||
TL: this.setLeading,
|
||||
Tf: this.setFont,
|
||||
Td: this.moveText,
|
||||
Tm: this.setTextMatrix,
|
||||
"T*": this.nextLine,
|
||||
Tj: this.showText,
|
||||
TJ: this.showSpacedText,
|
||||
|
||||
|
@ -1788,6 +1791,9 @@ var CanvasGraphics = (function() {
|
|||
},
|
||||
endText: function() {
|
||||
},
|
||||
setLeading: function(leading) {
|
||||
this.current.leading = leading;
|
||||
},
|
||||
setFont: function(fontRef, size) {
|
||||
var fontRes = this.res.get("Font");
|
||||
if (!fontRes)
|
||||
|
@ -1809,6 +1815,9 @@ var CanvasGraphics = (function() {
|
|||
this.current.x = this.current.lineX = 0;
|
||||
this.current.y = this.current.lineY = 0;
|
||||
},
|
||||
nextLine: function() {
|
||||
this.moveText(0, this.current.leading);
|
||||
},
|
||||
showText: function(text) {
|
||||
this.ctx.save();
|
||||
this.ctx.translate(0, 2 * this.current.y);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue