This content has been marked as final. Show 3 replies
I think it depends upon the font. Also what do you mean the _y position of the top of the first line? The top of the letter "A" or the top of "."?
But I think a general solution for your problem will be the getTextExtent() method of the the TextFormat class. I think you could use it to find the baseline and then go up the amount of the ascent. Maybe?
Thanks for the reply. What I mean by the _y position is the top of the A. I'm translating a docuement created using a Flash interface into a third party format. To do that I have to convert the font metrics line by line into the third partys markup.
From what I've found so far it appears that a line in a textfield is 1 1/9, I have no idea why the chose that ratio, the size of the largest font contained in that line. So I can take that plus a 2px padding in the field to determine the _y start of the actual characters.
Now I'm trying to find out how spacing between lines is determined. The default leading is 2px which with 36 point font is correct. Now, if I bump the font to 96 pixels the space between lines is 12px. Thoughts anyone?
I think I found the answer to the leading issue. It looks like it is using exact pixel values after all between lines.