Jan Zich
Jan Zich

Reputation: 15323

Extraneous text padding in Flash

It seems that flash.text.TextField in Flash has some built-in padding. In particular, my problem is that I need to left-align a text with some other graphical elements, and there is visible (about 3px) offset. The class flash.text.TextField (or any other related text class) does not seem to have property which could change it.

I know that it may not qualify as a strict programming question, because it’s also a problem is Flash (as in the program itself), but there is some programming involved and, honestly, Stackoveflow is the best place to ask.

Edit: The 3px I mentioned above were for a particular font size. The padding depends on the font size as well.

Upvotes: 1

Views: 1573

Answers (2)

schnaader
schnaader

Reputation: 49719

According to this page, this is a fixed 2px "gutter", so it should be enough to translate the Textfield 2 pixels to the left. You can also try to use flash.text.TextField.getLineMetrics() to get information about other paddings.

Upvotes: 4

tehnomaag
tehnomaag

Reputation: 186

I believe this depends on the font used. Usually there is some left sidebearing set in font metrics, and that is the offset that you see. Fix is to move the textfield a few pixels to counteract the sidebearing margin.

You can read more on font sidebrearings here.

Upvotes: 1

Related Questions