1、渲染文字:
<style>canvas {width: 500px;height: 300px;border: 1px solid;}</style></head><body><canvas id="can" width="500px" height="300px"></canvas><script>var canvas = document.getElementById("can");var ctx = canvas.getContext("2d");ctx.beginPath();ctx.strokeRect(0,0,200,200);ctx.font = "30px Georgia";//font大小对俩都有作用ctx.strokeText("panda",200,100);//文字描边:空心字ctx.fillStyle = "red";ctx.fillText("monkey",200,300);//文字填充:fillStyle对他有用,相当于普通文字,实体字</script></body>
