如何使用html5中的画布canvas绘制文字
1、第一步,在www目录下的form文件夹下,新创建一个文件001.html。


4、第四步,绘制文字。主要利用了context对象的基本属性font和方法fillText()、strokeText(),font可以设置字体的样式、大小、字形。两种方法的具体语法如下:context.fillText(text,x,y,maxwidth) 其中text是输入的文本,maxwidth是可选参数。context.strokeStyle(text,x,y,maxwidth) 该方法可绘制只有strokeStyle边框的文字,参数与含义与上一个方法相同。
