Hello Reader's if you want to write special heading in the custom way in web page then you can use the custom html function as below:-
This function will take the font face and size from user and generate the given text into a picture.
<!DOCTYPE html>
<html>
<body>
<canvas id="custom" width="400" height="400" style="border:3px solid #fff456;">
</canvas>
<script>
var MyCanvas = document.getElementById("myCanvas");
var gettingthecanvas= MyCanvas .getContext("2d");
gettingthecanvas.font = "30px Arial";
gettingthecanvas.strokeText("This is example blog",80,190);
</script>
</body>
</html>
Now paste the code above in your html file and make the following adjustments,
First you have to write your text in the place of "This is example blog". Now choose the font in the place of Arial", Also you can set the font size there. Once the page will load page will show your text generated picture with your font and size.
0 Comment(s)