|
|
@ -3925,24 +3925,24 @@ var CanvasGraphics = (function() { |
|
|
|
showText: function(text) { |
|
|
|
showText: function(text) { |
|
|
|
// TODO: apply charSpacing, wordSpacing, textHScale
|
|
|
|
// TODO: apply charSpacing, wordSpacing, textHScale
|
|
|
|
|
|
|
|
|
|
|
|
this.ctx.save(); |
|
|
|
var ctx = this.ctx; |
|
|
|
this.ctx.transform.apply(this.ctx, this.current.textMatrix); |
|
|
|
var current = this.current; |
|
|
|
this.ctx.scale(1, -1); |
|
|
|
|
|
|
|
|
|
|
|
ctx.save(); |
|
|
|
|
|
|
|
ctx.transform.apply(ctx, current.textMatrix); |
|
|
|
|
|
|
|
ctx.scale(1, -1); |
|
|
|
|
|
|
|
|
|
|
|
if (this.ctx.$showText) { |
|
|
|
if (this.ctx.$showText) { |
|
|
|
this.ctx.$showText(this.current.y, Fonts.charsToUnicode(text)); |
|
|
|
ctx.$showText(current.y, Fonts.charsToUnicode(text)); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
text = Fonts.charsToUnicode(text); |
|
|
|
text = Fonts.charsToUnicode(text); |
|
|
|
this.ctx.translate(this.current.x, -1 * this.current.y); |
|
|
|
ctx.translate(this.current.x, -1 * this.current.y); |
|
|
|
|
|
|
|
|
|
|
|
var font = this.current.font; |
|
|
|
var font = this.current.font; |
|
|
|
if (font) { |
|
|
|
if (font) |
|
|
|
var fontInfo = Fonts.lookupById(font.id); |
|
|
|
ctx.transform.apply(ctx, font.textMatrix); |
|
|
|
if (fontInfo && fontInfo.properties.textMatrix) |
|
|
|
ctx.fillText(text, 0, 0); |
|
|
|
this.ctx.transform.apply(this.ctx, fontInfo.properties.textMatrix); |
|
|
|
current.x += Fonts.measureText(text); |
|
|
|
} |
|
|
|
|
|
|
|
this.ctx.fillText(text, 0, 0); |
|
|
|
|
|
|
|
this.current.x += Fonts.measureText(text); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.ctx.restore(); |
|
|
|
this.ctx.restore(); |
|
|
|