Found 6685 Articles for Javascript

How to add underline to Text using FabricJS?

Rahul Gurung
Updated on 13-Sep-2022 11:56:59

480 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 text − This parameter ... Read More

How to add superscript with Text using FabricJS?

Rahul Gurung
Updated on 13-Sep-2022 11:55:38

145 Views

In this tutorial, we are going to learn how to add superscript with 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 add superscripts by using the setSuperscript method. Syntax setSuperscript(start: Number, end: Number) Parameters start − This parameter accepts a Number as value. The value given determines ... Read More

How to add subscript with Text using FabricJS?

Rahul Gurung
Updated on 13-Sep-2022 11:54:36

141 Views

In this tutorial, we are going to learn how to add subscript with 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 add subscripts by using the setSubscript method. Syntax setSubscript(start: Number, end: Number) Parameters start − This parameter accepts a Number as value. The value given determines ... Read More

How to add stroke to Text using FabricJS?

Rahul Gurung
Updated on 13-Sep-2022 11:53:04

180 Views

In this tutorial, we are going to learn how to add stroke 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, line height which can be obtained by the properties textAlign, underline and lineHeight respectively. We can add stroke by using the stroke property. Syntax new fabric.Text(text: String, { stroke: String }: Object) Parameters text − This parameter accepts a String which is the ... Read More

How to add space between characters in Text using FabricJS?

Rahul Gurung
Updated on 13-Sep-2022 11:51:42

307 Views

In this tutorial, we are going to learn about how to add space between characters in 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. We can also add extra space between each character by using the charSpacing property. Syntax new fabric.Text(text: String , { charSpacing: Number }: Object) Parameters ... Read More

How to add linethrough to Text using FabricJS?

Rahul Gurung
Updated on 13-Sep-2022 11:50:20

146 Views

In this tutorial, we are going to learn about how to set the text decoration 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, font family, line height which can be obtained by the properties textAlign, fontFamily and lineHeight respectively. We can add linethrough by using the linethrough property. Syntax new fabric.Text(text: String , { linethrough: Boolean }: Object) Parameters text − This parameter accepts ... Read More

How to add line height to multiline text in Text using FabricJS?

Rahul Gurung
Updated on 13-Sep-2022 11:48:25

514 Views

In this tutorial, we are going to learn about how to add line height to multiline text 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 add extra height between lines by using the lineHeight property. Syntax new fabric.Text(text: String, { lineHeight: Number }: Object) Parameters text ... Read More

How to add animation in Text using FabricJS?

Rahul Gurung
Updated on 13-Sep-2022 11:47:12

630 Views

In this tutorial, we are going to learn how to add animation 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 animate text by using the animate method. Syntax animate(property: String | Object, value: Number | Object) Parameters property − This property accepts a String ... Read More

How to straighten an IText object using FabricJS?

Rahul Gurung
Updated on 13-Sep-2022 10:02:14

127 Views

In this tutorial, we are going to learn about how to straighten 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 for IText as height is ... Read More

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

Rahul Gurung
Updated on 13-Sep-2022 09:11:55

118 Views

In this tutorial, we are going to learn how to shift the baseline of individual characters 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 automatically. This is not true for IText ... Read More

Advertisements