Fabric.js | Text stroke Property
In this article, we are going to see how to add a stroke 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. Further, the text itself cannot be edited like a textbox.
fabric.text(text :string, stroke:string);
Parameters: This function accept two parameters as mentioned above and described below:
- text: This parameter specifies the text.
- stroke: This parameter defines the color of the stroke.
Example: This example uses FabricJS to add stroke to text canvas as given below.