Hi Charlie,

Getting a line count for text members is doable if all the text is 
formated to the same font and line spacing. If that's the case then the 
following should work

on getTextLineCount aTextMem

        --fixedLineSpace will return 0 if the line spacing was set automatically, 
so need to manually get the height of the first character, and add 1 
because Director always returns a height 1 pixel less than the true line 
spacing for the first line (at least on my Windows machine it does

        lineHeight=aTextMem.charPosToLoc(1)+1

        lastChar=aTextMem.text.chars.count
        totalHeight=aTextMem.charPosToLoc(lastChar)
        lineCount=totalHeight/lineHeight
        return lineCount
end

If you are dealing with multiple fonts and line spacing then I think you 
are out of luck. Which it too bad because field members deal with multi 
fonts just fine, but there is no line spacing in them to complicate matters.

hth,

Rob


Charlie Fiskeaux II wrote:

> I know about linecount for field members (it counts every wrapped return as
> a new line as well as soft and hard returns), but is there any way to get
> the count of wrapped lines of text members?  member(x).text.lines.count only
> gives hard and soft return lines.


[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to