Kannada Font on Android ICS

ぃ、小莉子 提交于 2019-11-28 01:11:32

问题


I am supporting Tamil and Kannada fonts in my application. I use the following code to set the typeface of TextViews, Buttons, etc

FONT_TAMIL = Typeface.createFromAsset(getAssets(), "fonts/tamil.ttf");
tvTitle.setTypeface(FONT_TAMIL);

FONT_KANNADA = Typeface.createFromAsset(getAssets(), "fonts/kannada.ttf");
tvTitle.setTypeface(FONT_KANNADA);

I am able to display Tamil characters properly even on GingerBread. But I am not able to show the Kannada font. Can anyone please help me to find where I am going wrong?

An example screenshot of Tamil..

An example screenshot of Kannada..

Thanks, Karthik


回答1:


Did you tried replaceAll function to replace each and every Unicode characters to Ascii? You can use Character Map tool in Windows to get the equivalent ASCII characters for each of your Kannada/Tamil characters.

1) First you install both Unicode and Kannada font in your PC.

2) Then open two windows of character map tool.Select Unicode font in first window and Ascii in second one.

3) In both windows, double click the desired characters (same character in both windows).So the character will be displayed in the textbox.Copy that character from both windows and add them to replaceAll function.

Its takes long to copy each and every characters and character combinations.But I dont think there is another method to display unicode properly below ICS version.You need to convert it.And ofcourse hardwork leads to success :) Best wishes bro...



来源:https://stackoverflow.com/questions/16455923/kannada-font-on-android-ics

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!