getTextHeight() and getLineHeight() don't work
Here is a demostration of the problem:
http://jsfiddle.net/KJCTN/2/
I am not sure as what you are defining as the TextHeight or the LineHeight of a text.
I am trying to create a text and as I type I want to to know how many lines I have or the height of the text. As I type and hit enter and therefore go into a newline I would expect for the getTextHeight value returned to increase similiar to when I type and the width increases . But as the example show only the width is actually updated the getTextHeight() and getLineHeight() always have the same value.
Currently, textHeight is the height of an individual character and lineHeight is a ratio controlling how tall the line is compared to a character.
For example a textHeight of 16 and a lineHeight of 2 gives a line which is 2*16=32 units tall and has characters which are 16 units tall (there will be some space between the lines). A textHeight of 12 and a lineHeight of 0.5 creates lines 6 units tall with the characters are 12 units tall (ie lines will overlap slightly).
You can determine how many lines of text you have with yourStringObj.split('\n').length or kineticTextObj.textArr.length. You can determine the total height of your block of text by multiplying by both the lineHeight and textHeight. The following should give you the height of your text block (similar to the width):
text.getTextHeight()*text.getLineHeight()*text.textArr.length
text is your Kinetic.Text object.
This logic is already built into the getHeight() method. Check it out here:
https://github.com/ericdrowell/KineticJS/blob/master/src/shapes/Text.js#L167
You should always use getHeight to get the height of the text object because it does all of the calculations for you.
The confusion is my fault for not writing better docs for the method. I'll fix this soon.
thank you