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.
- How to add stroke width of text canvas using Fabric.js ?
- CSS | stroke-width Property
- CSS | stroke-linecap Property
- CSS | stroke-opacity Property
- CSS | stroke-dashoffset Property
- CSS | stroke-dasharray Property
- CSS | stroke-linejoin Property
- CSS | stroke-miterlimit Property
- Fabric.js | Circle stroke Property
- Fabric.js | Rect stroke Property
- Fabric.js | Triangle stroke Property
- Fabric.js | Ellipse stroke Property
- Fabric.js Polyline stroke Property
- CSS stroke-color property
- HTML | canvas stroke() Method
- p5.js | stroke() Function
- Node.js | GM stroke() Function
- How to set stroke width of a canvas circle using Fabric.js ?
- SVG Stroke Properties
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.