I have a requirement where the letters in a TextView need to be spaced a little farther apart. Unfortunately, most of the resources I find seem to say this cannot be done--at least not easily.
So far, the apparent solutions are:
- Add spaces in between the characters in the String-- "A B C" instead
of "ABC". Of course, that doesn't work if only a LITTLE more space
is needed.
- Change textScale, but that affects the size of the letters, not just the spacing between letters
- Use the Font class, but that isn't available until Honeycomb (I need something Gingerbread compatible) and it has been deprecated
in JellyBean, so that's not a good option.
- Find a font with different kerning, but that's not practiif clients want to use the same font.
- Override onDraw for a View, drawing characters to the Canvas one character at a time, manually specifying exactly where each character should be drawn.
Is there something I'm missing? It seems like there should be a better way. I see TextAttribute.KERNING and TextAttribute.TRACKING... it seems like those should be able to be used easily, but I can't figure out how.
What's the best way to change the spacing between letters in a TextView?