Rahul Gurung

Rahul Gurung

490 Articles Published

Articles by Rahul Gurung

Page 46 of 49

How to set the text overline of Text using FabricJS?

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

In this tutorial, we are going to learn how to set the text overline of Text using FabricJS. We can display text on canvas by adding an instance of fabric.Text. Not only does it allow us to move, scale and change the dimensions of the text but it also provides additional functionality like text alignment, text decoration, line height which can be obtained by the properties textAlign, underline and lineHeight respectively. Similarly we can also set the text overline by using the overline property. Syntax new fabric.Text(text: String , { overline : Boolean }: Object) ...

Read More

FabricJS – How to set the border opacity of a Line while moving it?

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

In this tutorial, we are going to learn about how to set the border opacity of Line while moving using FabricJS. A Line element is one of the basic elements provided in FabricJS. It is used for creating straight lines. Because line elements are geometrically one-dimensional and do not contain an interior, they are never filled. We can create a line object by creating an instance of fabric.Line, specifying the x and y coordinates of the line and adding it to the canvas. In order to change the opacity of the border of a line object while moving it around ...

Read More

FabricJS – How to set the colour of the controlling corners of a Line?

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

In this tutorial, we are going to learn about how to set the colour of the controlling corners of Line using FabricJS. A Line element is one of the basic elements provided in FabricJS. It is used for creating straight lines. Because line elements are geometrically one-dimensional and do not contain an interior, they are never filled. We can create a line object by creating an instance of fabric.Line, specifying the X and Y coordinates of the line and adding it to the canvas. The cornerColor property allows us to manipulate the colour of the controlling corners when the object ...

Read More

How to shift the baseline of individual characters in Text using FabricJS?

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

In this tutorial, we are going to learn how to shift the baseline of individual characters in Text using FabricJS. We can display text on canvas by adding an instance of fabric.Text. Not only does it allow us to move, scale and change the dimensions of the text but it also provides additional functionality like text alignment, text decoration, line height which can be obtained by the properties textAlign, underline and lineHeight respectively. Similarly, we can also shift the baseline of individual characters by using the deltaY property. Syntax new fabric.Text(text: String , { styles: { deltaY: ...

Read More

How to set the duration of animation on a Line using FabricJS?

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

In this tutorial, we are going to learn how to set the duration of animation on a Line using FabricJS. A Line element is one of the basic elements provided in FabricJS. It is used for creating straight lines. Because line elements are geometrically one-dimensional and do not contain an interior, they are never filled. We can create a line object by creating an instance of fabric.Line, specifying the x and y coordinates of the line and adding it to the canvas. In order to change the duration of animated text we use the duration property. Syntax ...

Read More

How to set the border scale factor of Rectangle using FabricJS?

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

In this tutorial, we are going to learn how to set the border scale factor of a Rectangle using FabricJS. Rectangle is one of the various shapes provided by FabricJS. In order to create a rectangle, we will have to create an instance of fabric.Rect class and add it to the canvas. We can use the borderScaleFactor property which specifies the scale factor of the object's controlling borders. This property controls the thickness of the selection border that appears when an object is selected on the canvas. Syntax ...

Read More

FabricJS – How to identify if the given object is of a Polygon instance?

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

We can create a Polygon object by creating an instance of fabric.Polygon. A polygon object can be characterized by any closed shape consisting of a set of connected straight line segments. 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 identify if the given object is of a Polygon instance, we use the isType method. This method checks if the object is of the specified type and returns a true or false value depending on that. Syntax isType(type: String): ...

Read More

FabricJS – How to set Polygon objects properties using function instead of constructor?

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

We can create a Polygon object by creating an instance of fabric.Polygon. A polygon object can be characterized by any closed shape consisting of a set of connected straight line segments. Since it is one of the basic elements of FabricJS, we can also easily customize it by applying properties like angle, opacity etc. Syntax set(key: String, value: String | Boolean | Number | Object | Function) Parameters key − This parameter accepts a String which specifies the property we ...

Read More

How to set the minimum allowed scale value of Rectangle using FabricJS?

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

In this tutorial, we are going to learn how to set the minimum allowed scale of Rectangle using FabricJS. Rectangle is one of the various shapes provided by FabricJS. In order to create a rectangle, we will have to create an instance of fabric.Rect class and add it to the canvas. We can customize a rectangle object by adding a fill colour to it, eliminate its borders or even make changes in its dimensions. Similarly, we can also set its minimum allowed scale by using the minScaleLimit property. Syntax new fabric.Rect({ minScaleLimit : Number }: Object) ...

Read More

FabricJS – Implementing object duplication programmatically on a Polygon?

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

We can create a Polygon object by creating an instance of fabric.Polygon. A polygon object can be characterized by any closed shape consisting of a set of connected straight-line segments. 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 implement object duplication programmatically we need to implement duplicate control using the clone method. Syntax clone(callback: Object, propertiesToInclude: Array) Parameters Callback (optional) − This parameter is a ...

Read More
Showing 451–460 of 490 articles
Advertisements