context.fillText()和context.strokeText()之间是否有任何区别,除了第一个使用context.fillStyle而后者使用context.strokeStyle.他们没有添加context.textStyle属性的任何原因?
解决方法
是的,strokeText实际上描绘了字母的轮廓,而fillText填充了字母的内部.
ctx.fillStyle='red';
ctx.strokeStyle='green'
ctx.linewidth=3;
ctx.font='90px verdana';
ctx.fillText('Q',50,150);
ctx.strokeText('Q',125,150);
ctx.fillText('Q',200,150);