FabricJS Articles

Page 48 of 51

How to set the style of individual characters in Text using FabricJS?

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

In this tutorial, we are going to learn how to set the style 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 set the style of individual characters by using the styles property. Syntax new fabric.Text(text: String , { styles: Object }: ...

Read More

How to set the text alignment of Text using FabricJS?

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

In this tutorial, we are going to learn how to set the text alignment of text 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 set its text alignment by using the textAlign property. Syntax new fabric.Text(text: String , { textAlign : String }: Object) ...

Read More

How to set the text overline of Text using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 311 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

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

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 426 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 a Polygon is different from a Polyline in FabricJS?

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

We can create a Polyline object by creating an instance of fabric.Polyline while fabric.Polygon can be used to create a Polygon instance. A polyline object can be characterised by 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. A polygon always connects the first point to the last to make a closed area while a polyline doesn't. This can be proved by the examples given below. Syntax new fabric.Polyline(points: Array, options: Object) new fabric.Polygon(points: Array, options: ...

Read More

How to set stroke width of a canvas circle using Fabric.js ?

Gungi Mahesh
Gungi Mahesh
Updated on 15-Mar-2026 535 Views

The stroke and strokeWidth properties are used to set the stroke color and width of a canvas circle in Fabric.js. These properties allow you to customize the border appearance of circle objects. The Fabric.js Circle class provides a rich set of features for creating interactive circles. Unlike basic HTML5 canvas circles, Fabric.js circles are movable, resizable, and highly customizable with properties for stroke, fill, dimensions, and positioning. Syntax fabric.Circle({ radius: number, stroke: string, strokeWidth: number }); Parameters radius − Specifies the radius of the ...

Read More

How to remove controls of a text canvas using Fabric.js?

Mohit Panchasara
Mohit Panchasara
Updated on 26-Jul-2023 725 Views

Fabric.js is a powerful tool written in JavaScript that makes it easier to build applications with interactive and dynamic graphics using HTML5 canvas. It offers many useful features, including the ability to add controls such as resizing and rotation handles to objects on the canvas. Sometimes, though, you might want to take away these controls from certain objects, like text, to limit what users can do. In this article, we'll show you how to remove controls from a text canvas using Fabric.js, using a simple example that you can follow along with. How to Remove Controls of a Text? To ...

Read More

Fabric.js Circle centeredScaling Property

Shabaz Alam
Shabaz Alam
Updated on 13-Apr-2023 390 Views

Fabric.js is a powerful JavaScript library that enables you to create and manipulate canvas objects with ease. The centeredScaling property is one of the useful properties in fabric.js, which is very helpful when working with circles. This property allows us to scale the circle from its center point. It is incredibly helpful in certain design scenarios. What is Centered Scaling? Centered scaling is a property of Fabric.js objects that allows us to resize an object from its center point instead of a corner. This property maintains the position of the object relative to its center point, which means that it ...

Read More

How to change selection background color of a canvas circle using Fabric.js?

Gungi Mahesh
Gungi Mahesh
Updated on 24-Feb-2023 509 Views

The Fabric.js Circle class is used to provide the circle shape by using the fabric.Circle object. The Circle object is used to provide the circle shape, and the circle is movable, and it can be stretched according to the requirements. For the stroke, color, width, height, and fill color the Circle is customizable. Comparing to the canvas class the Circle class provides the rich functionality. The Circle class contains the different properties, but to change the selection background color of a canvas circle can be done using selectionBackgroundColor property. The selectionBackgroundColor property of a Fabric.js class specifies to change the ...

Read More

How to set position relative to top of a canvas circle using Fabric.js?

Gungi Mahesh
Gungi Mahesh
Updated on 24-Feb-2023 499 Views

The Circle class of Fabric.js which is used to provide the circle shape by using the fabric.Circle object. The Circle object is used to provide the circle shape, and the circle is movable, and it can be stretched according to the requirements. For the stroke, color, width, height, and fill color the Circle is customizable. Comparing to the canvas class the Circle class provides the rich functionality. The Circle class contains the different properties, but to set the position relative to top of a canvas circle can be done using top property. The top property of a Fabric.js class specifies ...

Read More
Showing 471–480 of 506 articles
Advertisements