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