In this article, we are going to see how to change the font-weight of a canvas-like text using FabricJS. The canvas means text written is movable and can be stretched according to requirement. Further, the text itself cannot be edited like a textbox.
fabric.Text(text, fontWeight: number|string);
Parameters: This function accepts two parameters as mentioned above and described below:
- text: It specifies the text to be written.
- fontWeight: It specifies the font-weight which can be bold, normal, 400, 500 etc.
Program: This example uses FabricJS to change font-weight of canvas-like text.
- How to change the color of selected text using CSS ?
- How to Change the Text of a Button using jQuery?
- How to change the placeholder text using jQuery?
- JQuery | Change the text of a span element
- How to change font-family of a text canvas using Fabric.js ?
- How to change the font size of a text canvas using Fabric.js ?
- How to change the font style of a text canvas using Fabric.js ?
- How to change border-color of a canvas text using Fabric.js ?
- How to change character spacing of text canvas using Fabric.js ?
- How to change corner style of a canvas-type text using Fabric.js ?
- How to change background color of canvas-type text using Fabric.js ?
- HTML | DOM Style fontWeight Property
- Text Animation with changing the color of the text using HTML & CSS
- How to create long shadow of text without using text-shadow in HTML and CSS ?
- How to change SVG color ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.