FabricJS Articles

Page 45 of 51

How to add underline to Text using FabricJS?

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

In this tutorial, we are going to learn how to add underline to 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 overline, line height which can be obtained by the properties textAlign, overline and lineHeight respectively. Similarly we can also add underline to text by using the underline property. Syntax new fabric.Text(text: String , { underline: Boolean }: Object) Parameters ...

Read More

How to center a Text object horizontally and vertically on canvas using FabricJS?

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

In this tutorial, we are going to learn how to center a Text horizontally and vertically on canvas 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 center the text object horizontally and vertically on the canvas by using the center method. Syntax text.center() Parameters ...

Read More

How to center a Text object horizontally on canvas using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 1K+ Views

In this tutorial, we are going to learn how to center a Text horizontally on canvas 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 center the text object horizontally on the canvas by using the centerH method. Syntax centerH() Example 1: Default Text Position ...

Read More

How to center a Text object vertically on canvas using FabricJS?

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

In this tutorial, we are going to learn how to center a Text object vertically on canvas 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 center the text object vertically on the canvas by using the centerV() method. Syntax centerV() This method centers the text ...

Read More

How to change the font family of Text using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 2K+ Views

In this tutorial, we are going to learn about how to change the font family of Text object 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 font family by using the fontFamily property. Syntax new fabric.Text(text: String, { fontFamily: String }: Object) Parameters ...

Read More

How to change the font size of Text using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 1K+ Views

In this tutorial, we are going to see how to change the font size of a 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. The font size specifies how large or small the characters, displayed in our Text object, should be. We can change the font size by using the fontSize property. ...

Read More

How to change the font style of Text using FabricJS?

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

In this tutorial, we are going to learn about how to change the font style in Text object 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 font style by using the fontStyle property. Syntax new fabric.Text(text: String, { fontStyle: String }: Object) Parameters ...

Read More

How to change the font weight of Text using FabricJS?

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

In this tutorial, we are going to see how to change the font weight 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. Font weight refers to the value which determines how bold or light our text will appear. Syntax new fabric.Text(text: String , { fontWeight: Number|String }: Object) ...

Read More

How to compute the height of a character at given position in Text using FabricJS?

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

In this tutorial, we are going to learn how to compute the height of a line at a specific line index 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, and line height which can be obtained by the properties textAlign, underline and lineHeight respectively. We can also compute the height of a line at a required line index by using the getHeightOfLine method. Syntax ...

Read More

How to create a canvas with Text using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 1K+ Views

In this tutorial, we are going to learn about how to create a canvas with a Text object 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. One difference between Text and Textbox is, Textbox is editable interactively while Text isn't. Syntax new fabric.Text(text: String, options: Object) Parameters ...

Read More
Showing 441–450 of 506 articles
« Prev 1 43 44 45 46 47 51 Next »
Advertisements