How to add stroke width of text canvas using Fabric.js ?
In this article, we are going to see how to add stroke width to the text canvas using FabricJS. The canvas means text written is movable, rotatable, resizable, and can be stretched. But in this article, we will add a stroke width. Further, the text itself cannot be edited like a textbox.
fabric.text(text :string, strokeWidth: number, stroke);
Parameters: This function accepts three parameters as mentioned above and described below:
- text: It specifies the text.
- strokeWidth: It specifies the amount of width of stroke.
- stroke: It specifies the stroke color.
Program: This example uses FabricJS to add stroke width of canvas-like text as given below.