HTML5 画布文字描边大型字体
要在 HTML5 画布中正确绘制大字体,你可以尝试运行以下代码 −
var myCanvas = document.getElementById("myCanvas"); var context = myCanvas.getContext("2d"); context.font = '180pt Georgia'; context.strokeStyle = "#FF0000"; context.fillStyle = "#FFFFFF "; context.lineWidth = 34; context.fillText("Demo!",0,200); context.strokeText("Demo!",0,200);
广告