Is it possible, in a textpath, to set the text height? I want to stretch the text vertically.
var text = new Kinetic.TextPath({
x: 0,
y: 0,
fill: '#333',
fontSize: 24,
fontFamily: 'Arial',
text: '123456789',
data: 'M50,50 C60,0 140,0 150,50'
});
According to the documentation, there is a getTextHeight()
method. But there is no property textHeight
or a method like setTextHeight()
.
I would use a normal text object but, unfortunately, i have to curve the text.
Get text height is just a utility function which sends back a measurement, there is no 'Set' because there is nothing to set as you would be affecting the background styles.
Unfortunately there is no way to "stretch" the text right out of the box, you would have to do some odd workarounds to achieve this. Something like saving the item as an image and stretching the image, but I don't recommend this approach.
Your best bet is to scale the object, http://kineticjs.com/docs/Kinetic.TextPath.html#scaleY
myText.scaleY(2);