views:

25

answers:

1

I'm using the FontFitTextView that was posted in this other thread, but it isn't working exactly right for me. The measureText() call is returning a number that is obviously too small to display the string. When it runs through to find a font size that will allow the text to fit, the font size it settles on is still too big. I feel like there is some other kind of padding or margin or some other invisible that is contributing the math that makes up the width which is causing the discrepancy.

For example... I want to set the text of my FontFitTextView to be "10,000.25"

The width of my FontFitTextView is 96 pixels, with 8px padding on both sides, so my available width is 80 pixels. The call to measureText() says that the text "10,000.25" is 64 pixels wide. This means that the current font size should be small enough to display the entire string. However, when the string is actually drawn on the TextView the last 2 characters are chopped off and all I see is "10,000." instead of "10,000.25"

Any ideas?