It doesn't work because that are word wraps (soft breaks), not newlines (hardbreaks). Word wraps are not in a string that is a formatting feature of the software
which shows the string.
There is a workaround. Try
floor(Text.TextHeight/(Text.FaceSize+round(Text.FaceSize/3)))
TextHeight: the real height of the text in the textbox (in pixel).
FaceSize: Font size (in pixel).
Problem is, you have free space between the text lines, my guess was 1/3 of the font size. but this could vary (size , font itself). No clue if this always correct.