How to add a linethrough to a canvas-type text using Fabric.js ?
In this article, we are going to see how to add linethrough to a canvas-like text using FabricJS. The canvas means text written is movable and can be stretched, resized and rotated according to requirements. Further, the text itself cannot be edited like a textbox.
fabric.Text(text, linethrough: boolean);
Parameters: This function accepts two parameters as mentioned above and described below:
- text: It specifies the text to be written.
- linethrough: It specifies whether to enable or disable the linethrough text decoration, disabled by default.
Program: We can use FabricJS to add linethrough to a canvas-like text as given below.