I want to know that how good is android when supporting non-english characters? Is it possible to embed fonts in my app and make the app to use that font?
The system fonts already support Unicode language very well (as well as Eclipse, but you will have to select new encoding when saving, Eclipse will confirm this).
You can embed your fonts as well. Look at this tutorial and this discusstion.
More information: I'm working on Vietnamese. The system is perfect for Vietnamese, and I think it is for other languages, too.
FYI the emulator with android 2.3.3 support hebrew characters.
But you can use your own fonts if you want.
Place them in the res/assets folder, then
TextView txt = (TextView) findViewById(R.id.custom_font);
Typeface font = Typeface.createFromAsset(getAssets(), "my_font.ttf");
txt.setTypeface(font);
I'm a developer for a japanese company and i've hadno problems with japanese characters even on devices set for english. However, if you want to use custom fonts, use vvieux's code :)
Related
I have a rooted phone and was trying to play around with my phone. It has android 2.2 installed. What I want to do is to display Hndi/Tamil/Telugu text inside the application that I was trying to develop. Obviously android 2.2 does not support these fonts.
As the phone is rooted doing this was easy for one language. I just followed the tips given in this link Enable Hindi Fonts on Rooted Device and was able to get Hindi fonts throughout the system. Similar approach helped me setup Tamil fonts.
But I am not able to make both Hindi and Tamil work together. The possible solutions I can think off are :
i) Create a common ttf file which shall contain both Hindi and Tamil fonts. But I have no idea whether this is possible or not.
ii) Keep a .ttf file for each language in the assets/fonts/ folder but again this is showing just square boxes on the device.
I tried this link Display Different Languages In Applicationtoo but again this seems to work for only supported fonts.
Any guidance would be highly appreciated. Thanks
Try this sample application.I shared here the whole application code for how to display one text in multiple languages especially Kannada and Telugu.
Quick question: Can I use the Myanmar Language in an Android App? I guess the bigger question here is about unicode in general but I don't know what to ask about that.
Start from Android 4.3 , you can use Myanmar language in the app. Myanmar unicode has no more problem. However, Android still not support Myanmar language in default.
You can use Zawgyi or Unicode correctly in Android 4.3
You can use ttf font with #Ye Lin Aung mention
tv_mm3 = (TextView) findViewById(R.id.tv_mm3);
Typeface tf_mm3 = Typeface.createFromAsset(getAssets(), "fonts/mm3.ttf");
tv_mm3.setTypeface(tf_mm3);
For web, ttf font embed can't work. You need to use svg for Zawgyi. However, unicode ttf font can't work in android 4.3. It can't render after convert svg font. So, default webview with unicode is possible now.
for WebView , you need to put zawgyi svg font under the asset folder.
#font-face {
font-family:'Zawgyi-One';
src:url('file:///android_asset/fonts/zawgyi.svg');
}
If you want to use unicode in webview , you can use chromeview from https://github.com/pwnall/chromeview
I hope, my answer is useful for you.
Update:: Android 4.4 support Myanmar unicode and zawgyi show well on app and webview.
Disclaimer : I am a developer from Myanamr.
Yes. You can but it's not fully supported yet, IMHO. You can embed the font by using typeface.
You have to put your desire font in the assets folder first. Something like this will work.
tv_mm3 = (TextView) findViewById(R.id.tv_mm3);
Typeface tf_mm3 = Typeface.createFromAsset(getAssets(), "fonts/mm3.ttf");
tv_mm3.setTypeface(tf_mm3);
Slightly off topic, but I suggest you to try with a few fonts (either Unicode fonts or not). The rendering will be incorrect depends on the Android API version.
On latest API version 4.3, the Myanmar texts with Unicode fonts are rendered correctly on the TextView. I think it's enough for most of the applications. My suggestion is to use Myanmar3 Unicode font.
Language support comes in two stages:
The device needs to be able to print the languages' characters. Android has full UTF-8 support. This means you can print Strings in any language on the screen. BUT: Not all characters supported by the system are included in the default fonts. E.g. Tamil fonts are available, Sinhalese fonts are not.
Android official language support allows you to set the phones locale to whatever is available. The list of available locales is linked in the other answer. Being on that list means: the user can set the language of the app and the whole system. And you can have folders like res/values-de to show locale specific strings.
To test 1., you just need to open the phone's browser and look one a website in that language.
Check if the characters are shown or if you only see [] or just nothing.
To test 2., you need to check the android source code or some official documentation.
BUT, there is something in between:
If you see the characters but it is still not an official locale you can do the following:
Add resources for your language anyway: res/values-whatever and allow the user to choose the custom locale in the app's settings.
If the user has chosen whatever you can set the locale in EVERY Activity before doing anything else.
Here you can find a large list of supported languages with the localisation code:
What is the list of supported languages/locales on Android?
Below is an Android tutorial for supporting different languages in android app....
http://developer.android.com/training/basics/supporting-devices/languages.html
Hope this will help you.
Android 4.4+ has full Myanmar support including fonts. Informative article at http://viss.wordpress.com/2013/11/16/the-state-of-burmese-unicode/
Is there any way to support marathi font in android? I tried by adding font in assest forlder but not working. Is there any other way to do the same?
Maybe you used a font for the encoding ISCII 57002 (Devanagari), try a Unicode font, as Android uses UTF-8, Unicode. Maybe this. Not much experience in this area of Android.
Hi any body know how we can support Hindi and Gujrati Languge support in android. I used below code but it is not supported, I see only box.
I put string file in res/values-hi/string.xml folder. There is some key value for Hindi language. It is used for Hindi Language:
Locale locale = new Locale("hi");
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
getBaseContext().getResources()
.updateConfiguration(config,getBaseContext().getResources().getDisplayMetrics());
Anyone knows than please give me solution.
As gujarati and hindi languages are not supported by Android, you can still give that support to your Application.
For Gujarati copy the C:\WINDOWS\Fonts\Shruti.TTF file to your Assets folder click here to know how to make assets folder
then use the following code.
TextView text_view = new TextView(this);
Typeface font = Typeface.createFromAsset(getAssets(), "Shruti.TTF");
text_view.setTypeface(font);
text_view.setText("ગુજરાતી");
Shruti.TTF file is for Gujarati font.
Similarly you can add support for hindi file.
Hindi and many other Indian langy=uages are not supported in Android. Though HTC is planning to provide support for some Indian languages.Read Here.
Now, the code you used to put Hindi text in your app will only work if the Android phone has built in support for Hindi language.
You need to embed Hindi fonts in your app as Kri said.
Hindi reading method in opera mini 1 - First install latest version of "Opera Mini" on Android powered tablet or phone which is available free on Android Market. Otherwise go to official site of opera. (Read about Opera Mini & download) 2 - After that go to address bar & type opera:config and nothing should have www or http://. 3. Then come to the menu & at its end see "use bitmap fonts for complex scripts". No sentence will be written in front of. You change it to Yes. 4. Save it. Now Open any Hindi site and see hindi font on your mobile / tablet instead of square font.
Your can try the following also… Install Hindi font (including all Indian language) as system font - go this link:- http://android-bucket.blogspot.com/2011/07/hindi-font-installation-for-advance.html (Only for Advance users)
how to show hindi characters in android ,i have simple webview apllication ,it loads the url of some site which contains hindi characters ,but its showing [][][][ at place of those characters ,even the default android browser shows the same (not showing the hindi characters) the android version is 2.1, text encoding is set on unicode(UTF-8) in default android browser .,is there is any way to get the support for hindi characters
i hope my question is clear ,
Its the font-support
The Characters other than the most Basic ones, are not there in the TTF Font Files - Namely, DroidSans and DroidSansFallback
Any system needs to have the font on it to display the same.
In case of web pages, you can provide the font to the client to download and use
But in case of Android, its supposed to load characters only from DroidSans.ttf and DroidSansFallback.ttf
So if you want to view something in Hindi, these font files ( in system/fonts ) must support your characters
Your Options...
DroidSans.ttf is limited so you can't edit that. Download any font that has Hindi Character support and name it to DroidSans.ttf and replace in system/fonts.
- This will mess your default font
Download a TTF font that has Hindi Characters and Name it to DroidSansFallback.ttf and replace in system/fonts.
- This won't mess up anything & is a Better Option
Create a font using Font Designing Softwares and ADD as many characters as you wish (including HINDI) and follow the latter part of statement 2.
- The BEST Option !!
Use a Browser that has its own support for Hindi Fonts.
- Simplest option for people without ROOT *
* - Root implies Rooting of Android Device - Rooting Android
With Opera Mini browser, now you can read Indian language content on mobile phones which don't have built in unicode fonts. For this we need to turn
on the bitmap fonts in 'opera mini'
Type 'about: config' in mini address bar. This opens configuration settings.
There is a option for use bitmap fonts. Change that to Yes.
There is no way (not yet) to show any of the Indian characters of Indian languages on Android. It simply is not supported. See the following links for further information:
Link 1
Link2
It existed as a feature request, at least until 2.2. I am not sure if language support has been added for Hindi and other Indian languages from Android 2.3 and 3.0 onwards.
On a side note, does the same website work properly when you open it with a normal web browser?
Hindi is not supported in most devices.
But you still can browse Hindi websites using the app, SETT Hindi Browser if your Android version is above 2.2. It's an exclusive browser for Hindi & it displays Hindi in any device.
Here is the link: https://market.android.com/details?id=lk.bhasha.sett.hindi
Here is how it displays Hindi:
Me also struggled with this for one day but finally found a solution.
Just add these two lines of code it will work
WebSettings webSettings = webView.getSettings();
webSettings.setDefaultTextEncodingName("utf-8");