I'm trying to write text over an image using the Canvas Element.
I've set the font-weight to 900, but on mobile it doesn't show up.
On desktop it's fine and even testing it within responsive mode it looks fine, but when I make it live, the heavier font-weight doesn't come through on my phone.
I tried the code snippet in the comments of Debug JS modifying some specific canvas element to debug it and I found that for some reason the ctx.font
was only storing the font size and font name, but not the font weight.
I added the word bold
and it would store that, but not bolder
or a number value.
Does anyone have any idea what is going on here?
I've included a code snippet and a screenshot from my debugging that shows how it's storing the font value.
function main() {
// Put template on canvas
ctx.drawImage(img, 0, 0, size, size);
ctx.font = "bold 110px 'Saira Condensed', sans-serif";
ctx.textAlign = "center";
ctx.fillStyle = "#ffffff";
ctx.fillText(number, 325, 290);
}