In this article, we are going to see how to add underline to the canvas-like text using FabricJS. The canvas means text written is movable, rotatable, resizable, and can be stretched. But in this article, we will add underline to the text. Further, the text itself cannot be edited like a textbox.
fabric.text(text :string, underline: boolean);
Parameters: This function accepts two parameters as mentioned above and described below:
- text: It specifies the text.
- underline: It specifies whether to add underline or not.
Program: This example uses FabricJS add underline to canvas-like text as given below.\
- How to underline a text content using HTML ?
- How to remove underline for anchors tag using CSS?
- How to remove underline from a:before using CSS ?
- HTML | DOM Underline Object
- Text Animation with changing the color of the text using HTML & CSS
- How to create long shadow of text without using text-shadow in HTML and CSS ?
- How to add a linethrough to a canvas-type text using Fabric.js ?
- How to add overline to a text canvas using Fabric.js ?
- How to add default vertical scaling to a text canvas using Fabric.js ?
- How to add stroke width of text canvas using Fabric.js ?
- How to add vertical skew to a canvas-type text using Fabric.js ?
- How to Add Image in Text Background using HTML and CSS ?
- How to add shadow to text using CSS ?
- How to remove borders of a canvas-type text using Fabric.js ?
- Double Layered Text Effect using CSS
- How to override the current text direction using HTML ?
- How to disable text selection highlighting using CSS?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.