I am having a TextView that has a huge text in between i have a tamil word and i know how to embedd the tamil font in seperate textview .but i need the tamil word between english word please help thanks in advance
my part of text in textview :
Seasonal messages like welcome (நல்வரவு) is used in Kolam. Volunteering to draw kolam at temple is sometimes done when a devotee's
Try setting this Akshar.ttf font to your TextView through setTypeface, it suuports both English and Tamil.
Here is the outcome:
Or, look for a similar font which supports both language.
your second solution is to use image for this small Tamil text portion using SpannableStringBuilder.
Code for setting custom font to TextView:
Assuming you have the Akshar.ttf font in fonts folder under assets folder:
I had this problem in Android 4.0. I found that this is due to csc(Country Code). If it is a India then Tamil working correctly else not working. I can confirm this.
There is another solution if you want to support multiple fonts within a TextView but they are not supported within a single ttf:
Use the following code:(I'm using Bangla and Tamil font)
The outcome is:
CustomTypefaceSpan Class:
Reference
Till ICS (4.0) there were no Tamil font available in Android Systems. Even then it had bugs and Google fixed it all with Jelly Bean (4.2).
Now if you wanna show Tamil in your application you need to use TAB, TAM, BAMINI or TSCII encodings.
I wrote a simple library that does the conversion for you dynamically. All you have to write is simple code as below.
I have written more on this topic in this answer. Please check it out too.