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.
- Fabric.js | Triangle strokeDashOffset 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
- HTML | DOM Input Text type Property
- HTML | DOM Input Text size Property
- HTML | DOM Input Text pattern 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.