4
我有這樣的代碼動用我的HTML畫布一些文字:奇怪的字體行爲對HTML畫布
$("#canvastext").keyup(function(){
ctx.lineWidth = 8;
ctx.font = '20pt Arial';
ctx.strokeStyle = 'black';
ctx.fillStyle = 'white';
ctx.textAlign = 'center';
var text = document.getElementById('canvastext').value;
text = text.toUpperCase();
x = canvas.width/2;
y = canvas.height - canvas.height/4.5;
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.strokeText(text, x, y);
ctx.fillText(text, x, y);
});
但是,爲什麼有些字符有這個奇怪的形狀:
爲什麼A
, M,
V
,W
有難看的中風線?
一個'fiddle'將是非常有益的! –