Canvas - Using Custom Fonts

Im using a special font for the website using @ font-face. The font is rendered with DOM elements, but it is not suitable for CANVAS. What am I doing wrong?

Here is a demo: http://enriquemorenotent.com/demos/cube2/

+4
source share
1 answer

Good, funny. All I had to change was:

context.font = "36px myFont bold"; 

for

 context.font = '36px "myFont" bold'; 
+4
source

Source: https://habr.com/ru/post/1399406/


All Articles