Is there a way to set font-weight in KineticJS's Text object?
Here's example code:
var myText = new Kinetic.Text(
{
x: 350,
y: 50,
text: 'OK',
fontSize: 18,
fontFamily: 'Verdana',
fill: 'white'
});
I'd like the font-weight to be 100 or 200, rather than the default (400). Not finding a fontWeight property in the documentation, I tried the following without success:
Thanks for any tips.
Use the fontStyle property (Hint: the value must be a string--not number):
var myText = new Kinetic.Text({
x:100,
y:100,
text:"Hello World!",
fill: 'red',
fontFamily:"Calibri",
fontSize:18,
fontStyle:"100"
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With