如何在 HTML5 画布上绘制大型字体?
要正确地在 HTML5 画布上绘制大型字体,可以尝试运行以下代码
var myCanvas = document.getElementById("myCanvas"); var context = c.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);
广告