Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to write using custom font in HTML

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 295
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: