Skip to main content
1 of 2

using javascript canvas.context.scale resets custom font

i am making a HTML5 game using javascript with canvas. i am implementing a custom font adding @font-face style tag to header in .html file, then if i set canvas.context2D.font = "10px FONT_NAME" it works and until here i dont have an issue.

but when i scale context2D using canvas.context2D.scale i lost the font and when i try to set it again using canvas.context2D.font = "10px FONT_NAME" it does not work.

it is important to me to set different fonts cause a game can use those in different UI or levels, any idea?