I want to create an android application in which the user should be able to select a language of his choice(English/ Hindi/ Marathi).
I have checked some android forums and found that android does not support Devanagari fonts.
Is there a solution? Also, is there a solution without rooting the device?
As Devanagari fonts are not supported by Android, you can still give that support to your Application.
For Hindi font copy font file (saral.ttf or Shusha.ttf or any font hindi file) to your asset folder. then use the following code.
TextView text_view = new TextView(this);
Typeface font = Typeface.createFromAsset(getAssets(), "saral.TTF");
text_view.setTypeface(font);
text_view.setText("हिंदी");
the same way u can give support for marathi....
you can use following i18n solution for different languages
http://www.vogella.de/blog/2011/01/17/translating-android-applications-i18n/
http://www.kobu.com/i18n/android/index-en.htm
Related
I have an app with educational context I want to use an appropriate Persian font for reading. how can I know which fonts are available to use? (I mean, I do not want to download external one) and can anyone suggest a good Persian font for educational context?
Hi you can custom the fonts based on the view your looking for Download a font from internet and put it under assets/fonts folder.
tv1=(TextView)findViewById(R.id.textView3);
tv2=(TextView)findViewById(R.id.textView4);
Typeface face= Typeface.createFromAsset(getAssets(), "font/font.ttf");
tv1.setTypeface(face);
Typeface face1= Typeface.createFromAsset(getAssets(), "font/font1.ttf");
tv2.setTypeface(face1);
"Noto" is a standard Font for other Languages.
You can find "Noto" -- https://www.google.com/get/noto/
"Droid Arabic Naskh" is good and support persian, too.
Hi am developing One Android App in which am using Custom font .TTF file.The problem is i tested with same Branded Device with Different Build Version.the Older Version Device supporting Custom Font But new version Device not taking Custom Font.
i have one suggestion add those font in assets and make your text in html thus you can add it in Web View android
Hope it will work for your case:
WebView view = new WebView(this);
view.setVerticalScrollBarEnabled(true);
view.loadUrl("file:///android_asset/demo/intro.html");
((LinearLayout)findViewById(R.id.introLayout1)).addView(view);
view.setBackgroundColor(Color.BLACK)
first download the needed the ttf file (Font style which you want ). and put that it in the assets folder in android project. then add the following code in java file..
TextView txt = (TextView) findViewById(R.id.custom_font);
Typeface font = Typeface.createFromAsset(getAssets(), "Eltpan-n.ttf");
txt.setTypeface(font);
hope it will help you.. its worked like a charm for me .. if you satisfied vote for my answer
I have an app that must show some Malayalam text. I used some Malayalam fonts and tried to use that through typeface. Though all the characters are shown, some of the symbols are not shown or are displaced. I use android 2.2. Can anyone guide me to solve this problem?
As Malayalam fonts are not supported by Android, you can still give that support to your Application.
For Marathi font copy font file to your asset folder. then use the following code.
TextView text_view = new TextView(this);
Typeface font = Typeface.createFromAsset(getAssets(), "MalayalamFont.ttf");
text_view.setTypeface(font);
text_view.setText("മലയാളം");
the same way u can give support for hindi....
We can add font files to the assets folder and from there we can load it. here is useful link for you..
Display malayalam text in my app
hi
i want to develop an application in which i Want to use punjabi text. But my emmulator does not show Punjabi text. Is there any api or something else so that my emulator can show the punjabi text or suggest me any other way to implement punjabi language in my application.
Thanks in advance.
Typeface font = Typeface.createFromAsset(getAssets(), "bulara_5.ttf");
text.setTypeface(font);
text.setText("ਪੰਜਾਬੀ");
This worked for me on non rooted phone OSv 2.1
Link for font file I used: http://homepage.ntlworld.com/paul-grosse/bulara.zip
You can use custom TrueType fonts by copying the .ttf file into your projects's 'assets' folder.
Then in your application you can use the font like this;
final Typeface customF = Typeface.createFromAsset(this.getAssets(), "custom.ttf");
final TextView textV = (TextView) findViewById(...);
textV.setTypeface(customF);
However i've had so many problems trying to use TrueType fonts so you might want to do some real life testing with your (pubjabi) font.
I don't think that android 2.3 supports the punjabi font. Hence you see those boxes.
Follow this thread to know when your favourite language will be supported. I've heard that Samsung android devices support some Indian regional fonts.
hi
i want to develop an application in which i Want to use punjabi text. But my emmulator does not show Punjabi text. Is there any api or something else so that my emulator can show the punjabi text or suggest me any other way to implement punjabi language in my application.
Thanks in advance.
Typeface font = Typeface.createFromAsset(getAssets(), "bulara_5.ttf");
text.setTypeface(font);
text.setText("ਪੰਜਾਬੀ");
This worked for me on non rooted phone OSv 2.1
Link for font file I used: http://homepage.ntlworld.com/paul-grosse/bulara.zip
You can use custom TrueType fonts by copying the .ttf file into your projects's 'assets' folder.
Then in your application you can use the font like this;
final Typeface customF = Typeface.createFromAsset(this.getAssets(), "custom.ttf");
final TextView textV = (TextView) findViewById(...);
textV.setTypeface(customF);
However i've had so many problems trying to use TrueType fonts so you might want to do some real life testing with your (pubjabi) font.
I don't think that android 2.3 supports the punjabi font. Hence you see those boxes.
Follow this thread to know when your favourite language will be supported. I've heard that Samsung android devices support some Indian regional fonts.