FabricJS Articles

Page 46 of 51

How to create a Text with dash pattern border using FabricJS?

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

In this tutorial, we are going to create a Text with a dash pattern border 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. We can change the appearance of the dashes of border, by using the borderDashArray property. However, our text object must have borders in order for this property to work. If ...

Read More

How to disable the centered rotation of Text using FabricJS?

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

In this tutorial, we are going to learn how to disable the centered rotation 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. 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 ...

Read More

How to disable the centered scaling of Text using FabricJS?

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

In this tutorial, we are going to learn how to disable the centered scaling 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. When being scaled via controls, assigning a true value to the centeredScaling property, uses the center as the object's origin of transformation. Syntax new fabric.Text(text: String, ...

Read More

How to get the object scale factor of Text using FabricJS?

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

In this tutorial, we are going to learn how to get the object scale factor 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. We can also find the object scale factor by using the getObjectScaling method. Syntax getObjectScaling() This method returns an object containing the scaleX ...

Read More

How to get the opacity of Text object using FabricJS?

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

In this tutorial, we are going to learn how to get the opacity 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. We can also find the opacity of an object by using the getObjectOpacity method. Syntax getObjectOpacity() Example 1 Using the getObjectOpacity method Let's ...

Read More

How to get the scaled height of Text using FabricJS?

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

In this tutorial, we are going to learn how to get the scaled height 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. We can also find the object's scaled height by using the getScaledHeight method. Syntax getScaledHeight() Example 1: Using the getScaledHeight method Let's see ...

Read More

How to get the scaled width of Text using FabricJS

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

In this tutorial, we are going to learn how to get the scaled width 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. We can also find the object's scaled width by using the getScaledWidth method. Syntax getScaledWidth() Example 1: Using the getScaledWidth Method Let's see ...

Read More

How to get the style of current selection in Text using FabricJS?

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

In this tutorial, we are going to learn how to get the style of current selection 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. We can also find the style of current selection by using the getSelectionStyles method. Syntax getSelectionStyles(startIndexopt, endIndexopt, completeopt) Parameters ...

Read More

How to include Text object's default values in its serialization using FabricJS?

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

In this tutorial, we are going to learn how to include Text object's default values in its serialization 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 we can also add additional functionalities. Serialization is used in order to export canvas contents. In order to achieve this we use toObject() and toJSON() methods. The includeDefaultValues property allows us to include or omit the object's default values when being serialized. Syntax new fabric.Text(text: String, { includeDefaultValues: ...

Read More

How to make controlling corners of Text transparent using FabricJS?

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

In this tutorial, we are going to learn how to make the controlling corners of Text transparent 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. The transparentCorners property allows us to make the controlling corners of Text object transparent. Syntax new fabric.Text(text: String, { transparentCorners: Boolean }: Object) ...

Read More
Showing 451–460 of 506 articles
« Prev 1 44 45 46 47 48 51 Next »
Advertisements