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
Press (Ctrl + G) together to toggle (switch) between English and Tamil language.
The reason is Character encoding. You have to set character Encoding UTF-8 to see Tamil characters properly on web browsers.
Under fonts -> add more fonts -> Scripts -> Choose 'Tamil' -> Click the Font Style you like and add it your 'My fonts' (you can see on the right pane). Finally, click Ok to add the fonts.
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.
Assuming you have the Akshar.ttf font in fonts folder under assets folder:
Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/Akshar.ttf");
TextView tv = (TextView) findViewById(R.id.CustomFontText);
tv.setTypeface(tf);
tv.setText("Seasonal messages like welcome (நல்வரவு) is used in Kolam. Volunteering to draw kolam at temple is sometimes done when a devotee's");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With