这只是个问题
Arial
字体;尝试
Calibri
问题就不复存在了!
我只换了一行
ctx.font = "24px Arial";
进入之内
ctx.font = "24px Calibri";
测试它
here
.
更新
(也可修复):
这也将解决Arial的问题:
var text = "This is the canvas M";
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.font = "24px Arial";
ctx.lineJoin = 'round'; //ADD THIS LINE
ctx.miterLimit = 2; //& THIS LINE
ctx.lineWidth = 4;
ctx.strokeStyle = "black";
ctx.strokeText(text, 5, 30);
ctx.fillStyle = "white";
ctx.fillText(text, 5, 30);