Help with understanding textField's :resizeFontToFitHeight

for a native.newTextField  I set the size to 12  and then after using the resizeFontToFitHeight, the new adjusted text size causes the text to slightly overspan the textField width by 1 character. HOWEVER, if I previously set the native.newTextField to 14 and then I use resizeFontToFitHeight, then the text fits nicely within the textField’s width.  How come when originally at a larger textsize, that it gets to be adjusted better and fits nicely within the textField’s width?

Is there any way to have the text adjust itself in a manner so that it doesn’t expand the textField’s width?

Are talking about horizontal or veritcal fit?

That function adjusts the font size so it best fits vertically in the field.

It is simply a helper function (that selects a font size) to make sure your text isn’t too short or too tall.

I’m curious too.  You must be pre-filling the fields for this to be a horizontal issue?

PS - What is the font size after you call this?  Is it different in your two sample cases? i.e. Is it different after calling the function if you start at 12 versus 14?

So yes, this is a horizontal issue for my placeholder text within the textfield box which needs to have it’s parameters at a fixed value. 

On corona’s SIMULATOR, on a zoomed in iphone 5, when I use font:  13.8 gets adjusted to 29.7 ;

                                                                                                                12 gets adjusted to 32.

So yes, after calling, they do appear as different sizes. In this case, out of for example 10 character spaces, all 10 characters comfortably fit width wise when size is reformatted to 29.7, but only 9 characters show if reformatted size is set to 32.

Any options to get around this?  :huh:

Are talking about horizontal or veritcal fit?

That function adjusts the font size so it best fits vertically in the field.

It is simply a helper function (that selects a font size) to make sure your text isn’t too short or too tall.

I’m curious too.  You must be pre-filling the fields for this to be a horizontal issue?

PS - What is the font size after you call this?  Is it different in your two sample cases? i.e. Is it different after calling the function if you start at 12 versus 14?

So yes, this is a horizontal issue for my placeholder text within the textfield box which needs to have it’s parameters at a fixed value. 

On corona’s SIMULATOR, on a zoomed in iphone 5, when I use font:  13.8 gets adjusted to 29.7 ;

                                                                                                                12 gets adjusted to 32.

So yes, after calling, they do appear as different sizes. In this case, out of for example 10 character spaces, all 10 characters comfortably fit width wise when size is reformatted to 29.7, but only 9 characters show if reformatted size is set to 32.

Any options to get around this?  :huh: