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