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.
- Fabric.js | Circle strokeDashArray Property
- Fabric.js | Rect strokeDashArray Property
- Fabric.js | Triangle strokeDashArray Property
- Fabric.js | Ellipse strokeDashArray Property
- Text Animation with changing the color of the text using HTML & CSS
- How to create long shadow of text without using text-shadow in HTML and CSS ?
- CSS | text-align Property
- CSS | text-decoration Property
- CSS | text-decoration-color Property
- CSS | text-decoration-line Property
- CSS | text-justify Property
- CSS | text-align-last Property
- CSS text-transform Property
- CSS | text-shadow Property
- CSS | text-indent Property
- CSS | text-decoration-style Property
- CSS | text-overflow Property
- HTML | DOM Option text Property
- HTML | DOM Input Text value Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.