In this article, we are going to see how to position relative to the top of the canvas-like text using FabricJS. The canvas means text written is movable, rotatable, resizable and can be stretched. But in this article, we will position relative to the top. Further, the text itself cannot be edited like a textbox.
fabric.text(text :string, top: number);
Parameters: This function accepts two parameters as mentioned above and described below:
- text: It specifies the text.
- top: It specifies the distance from the top.
Program: This example uses FabricJS to position relative to top of canvas-like text as given below.