Heyy guys.
First of all, I'm not trying to detect a \n in a text node. What I need to know is when/where a text will wrap to the other line.
My idea was to iterate over the TextNode, letter by letter, create a new TextNode compound of all letters until the current step, after that I would calculate the height of the text node, if the height of the current step is different from the previous one, then the line wrapped.
The problem is I'm having a hard time to figure out the height of the current text. This is what I have so far: http://jsfiddle.net/mfnAT/2/
You can see that the height returned by getTextNodeHeight
is incorrect and I don't know what is wrong. I found this function here.
Any of you guys know how to solve this? Or a better approach for this problem?