How can i change letter spacing in a textview? Will it help if I have HTML text in it (I cannot use webview in my code).
P.S. I'm using my own typeface in the textview with HTML text.
How can i change letter spacing in a textview? Will it help if I have HTML text in it (I cannot use webview in my code).
P.S. I'm using my own typeface in the textview with HTML text.
This answer is based on Pedro's answer but adjusted so it also works if text attribute is already set:
If you want to use it programatically:
For embedding HTML text in your textview you can use
Html.fromHTML()
syntax. More information you will get from http://developer.android.com/reference/android/text/Html.html#fromHtml%28java.lang.String%29after API >=21 there is inbuild method provided by TextView called
setLetterSpacing
check this for more
I built a custom class that extends
TextView
and solves this problem... Check out my answer here =)More space:
Less space:
As android doesn't support such a thing, you can do it manually with FontCreator. It has good options for font modifying. I used this tool to build a custom font, even if it takes some times but you can always use it in your projects.