Rahul Gurung

Rahul Gurung

490 Articles Published

Articles by Rahul Gurung

Page 11 of 49

How to add space between characters in IText using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 341 Views

In this tutorial, we are going to learn about how to add space between characters in an IText object using FabricJS. The IText class was introduced in FabricJS version 1.4, extends fabric.Text and is used to create IText instances. An IText instance gives us the freedom to select, cut, paste or add new text without additional configurations. There are also various supported key combinations and mouse/touch combinations which make text interactive which are not provided in Text. Textbox, however, which is based on IText allows us to resize the text rectangle and wraps lines automatically. This is not true ...

Read More

How to disable the centered rotation of a Circle using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 342 Views

In this tutorial, we are going to learn how to disable the centered rotation of Circle using FabricJS. Circle is one of the various shapes provided by FabricJS. In order to create a circle, we will create an instance of fabric.Circle class and add it to the canvas. By default, all objects in FabricJS use their center as the point of rotation. However, we can change this behaviour by using the centeredRotation property. Syntax new fabric.Circle({ centeredRotation: Boolean }: Object) Parameters options (optional) ...

Read More

How to lock the horizontal skewing of Textbox using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 261 Views

In this tutorial, we are going to learn how to lock the horizontal skewing of a Textbox using FabricJS. Just as we can specify the position, colour, opacity and dimension of a textbox object in the canvas, we can also specify whether we want to stop skewing an object horizontally. This can be done by using the lockSkewingX property. Syntax new fabric.Textbox(text: String, { lockSkewingX : Boolean }: Object) Parameters text − This parameter accepts a String which is the text string that we want to display inside our ...

Read More

How to center an object horizontally with respect to current viewport of canvas in IText using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 214 Views

In this tutorial, we are going to learn about how to center an object horizontally with respect to current viewport of canvas in IText using FabricJS. The IText class was introduced in FabricJS version 1.4, extends fabric.Text and is used to create IText instances. An IText instance gives us the freedom to select, cut, paste or add new text without additional configurations. There are also various supported key combinations and mouse/touch combinations which make text interactive which are not provided in Text. Textbox, however, which is based on IText allows us to resize the text rectangle and wraps lines ...

Read More

How to find the complexity of an Image instance using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 219 Views

In this tutorial, we are going to learn how to find the complexity of an Image instance using FabricJS. We can create an Image object by creating an instance of fabric.Image. Since it is one of the basic elements of FabricJS, we can also easily customize it by applying properties like angle, opacity etc. In order to find the complexity of an Image instance, we use the complexity method. This method will return 1 if the current object is directly inherited from a base class and not from a subclass. Syntax complexity(): Number Using the ...

Read More

How to set the angle of rotation of an Ellipse using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 404 Views

In this tutorial, we are going to set the angle of rotation of an Ellipse using FabricJS. Ellipse is one of the various shapes provided by FabricJS. In order to create an ellipse, we have to create an instance of fabric.Ellipse class and add it to the canvas. The angle property in FabricJS defines the angle of 2D rotation of an object. We also have the centeredRotation property that allows us to use the center point of an ellipse as the origin of transformation. Syntax new fabric.Ellipse({ angle: Number, centeredRotation: Boolean }: Object) Parameters ...

Read More

How to add dashed stroke to a Triangle using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 197 Views

In this tutorial, we are going to learn how to add a dashed stroke to a Triangle using FabricJS. Triangle is one of the various shapes provided by FabricJS. In order to create a Triangle, we will have to create an instance of fabric.Triangle class and add it to the canvas. The strokeDashArray property allows us to specify a dash pattern for the object's stroke. Syntax new fabric.Triangle({ strokeDashArray: Array }: Object) Parameters options (optional) − This parameter is an Object which provides ...

Read More

How to lock the rotation of Textbox using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 296 Views

In this tutorial, we are going to learn how to lock the rotation of a Textbox using FabricJS. Just as we can specify the position, colour, opacity and dimension of a textbox object in the canvas, we can also specify whether we want to allow rotation or not. This can be done by using the lockRotation property. Syntax new fabric.Textbox(text: String, { lockRotation : Boolean }: Object) Parameters text − This parameter accepts a String which is the text string that we want to display inside our textbox. ...

Read More

How to add stroke to IText using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 324 Views

In this tutorial, we are going to learn how to add stroke to IText using FabricJS. The IText class was introduced in FabricJS version 1.4, extends fabric.Text and is used to create IText instances. An IText instance gives us the freedom to select, cut, paste or add new text without additional configurations. There are also various supported key combinations and mouse/touch combinations which make text interactive which are not provided in Text. Textbox, however, which is based on IText allows us to resize the text rectangle and wraps lines automatically. This is not true for IText as height is ...

Read More

How to set the angle of skew on X-axis of Ellipse using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 211 Views

In this tutorial, we are going to learn how to set the angle of skew on X-axis of an Ellipse using FabricJS. Ellipse is one of the various shapes provided by FabricJS. In order to create an ellipse, we will create an instance of fabric.Ellipse class and add it to the canvas. Our ellipse object can be customized in various ways like changing its dimensions, adding a background color or by changing the angle of skew on X-axis. We can do this by using the skewX property. Syntax new fabric.Ellipse({ skewX : Number }: Object) ...

Read More
Showing 101–110 of 490 articles
« Prev 1 9 10 11 12 13 49 Next »
Advertisements