javascript - HTML 5 canvas font being ignored -
I am trying to write some text in a canvas element, but it seems that the font option which I completely I am doing defamation. It does not matter how I change them, it all goes out, which I believe is 10px sans-serif default. I have (this function runs on load)
start the function () {canvas = document.getElementById ('c'); Ctx = canvas.getContext ('2d'); Ctx.fillStyle = "white"; Ctx.font = "12px monospace"; Ctx.textBaseline = "top"; }
It does not work in Firefox or Chrome.
It may also be that if you reset the canvas size at least, Today is seen in Chrome 23.
context.font = 'bold 20px arial'; Canvas Wide = 100; Canvas Heights = 100; Console.log (context.font); // '10px sans-serif'
Comments
Post a Comment