绘制自动换行的字符串
drawText(ctx, txtwid, t, x, y, w){
var chr = t.split("");
var temp = "";
var row = [];
ctx.font = "20px Arial";
ctx.fillStyle = "black";
ctx.textBaseline = "middle";
for(var a = 0; a < chr.length; a++){
if( ctx.measureText(temp).width < w ){
;
}
else{
row.push(temp);
temp = "";
}
temp += chr[a];
}
row.push(temp);
for(var b = 0; b < row.length; b++){
ctx.setFontSize(txtwid);
ctx.setFillStyle("#333333");
ctx.fillText(row[b],x,y+(b+1)*20);
}
},