I want to draw fontawesome icons on the canvas.
Below is my code:
<canvas id="canvas" width="400" height="400" style="border:1px solid #d3d3d3;"></canvas>
<script>
var content = '\uF006';
var context = document.getElementById('canvas').getContext('2d');
context.font = '48px Material Design Icons';
context.fillText(content, 100, 100);
context.strokeText(content, 100, 100);
</script>
I have imported the font files and linked it. But it doesn't works: it just show a rectangle which is empty.
can you tell me why?
one interesting thing is that it works when I link the fontawesome version 4.5 online address : enter link description herewhere the difference between the two version?