0

I have tried making a custom TextView from Bart's answer here:

How to change letter spacing in a Textview?

But it doesn't seem to work for reducing the size of the spaces. When I use 0 as an argument for setSpacing(), it increases the spaces size. I wonder if this is because I'm using a custom font?

Any help on this is greatly appreciated.

EDIT: To clarify, I'm working with API 14 and can't use setLetterSpacing()which is a thing since API 21.

Community
  • 1
  • 1
Sean Thomas
  • 129
  • 12

1 Answers1

0

That's because you are using the wrong method. Use this instead:

setLetterSpacing(0)

Not

setSpacing(0)

If that doesn't work, try to make an external font from any online software, and just add it to your text view. You will need to add it to a font directory and then access it from there:

TextView textview = (TextView) findViewById(R.id.textView);
Typeface font = Typeface.createFromAsset(getContext().getAssets(), "fonts/Maximum.ttf");
textView. setTypeface(font);

You can find more information about using external fonts here.

user229044
  • 232,980
  • 40
  • 330
  • 338
Ruchir Baronia
  • 7,406
  • 5
  • 48
  • 83