this.ScratchCanvas = imageCanvas || ScratchCanvas;
}
+ var LINE_CAP_STYLES = [ "butt", "round", "square" ];
+ var LINE_JOIN_STYLES = [ "miter", "round", "bevel" ];
+ var NORMAL_CLIP = {};
+ var EO_CLIP = {};
+
+ // Used for tiling patterns
+ var PAINT_TYPE_COLORED = 1, PAINT_TYPE_UNCOLORED = 2;
+
constructor.prototype = {
map: {
// Graphics state
// Compatibility
BX: "beginCompat",
EX: "endCompat",
- };
- }
-
- var LINE_CAP_STYLES = [ "butt", "round", "square" ];
- var LINE_JOIN_STYLES = [ "miter", "round", "bevel" ];
- var NORMAL_CLIP = {};
- var EO_CLIP = {};
-
- // Used for tiling patterns
- var PAINT_TYPE_COLORED = 1, PAINT_TYPE_UNCOLORED = 2;
-
- constructor.prototype = {
+ },
+
translateFont: function(fontDict, xref, resources) {
var fd = fontDict.get("FontDescriptor");
if (!fd)
this.ctx.scale(1, -1);
if (this.ctx.$showText) {
- this.ctx.$showText(this.current.y, text, Fonts.charsToUnicode(text));
+ this.ctx.$showText(this.current.y, Fonts.charsToUnicode(text));
} else {
text = Fonts.charsToUnicode(text);
this.ctx.translate(this.current.x, -1 * this.current.y);
currentX = currentXStack.pop();
},
- "$showText": function(y, text, uniText) {
+ "$showText": function(y, text) {
this.translate(currentX, -1 * y);
- this.fillText(uniText, 0, 0);
+ this.fillText(text, 0, 0);
currentX += this.measureText(text).width;
},