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.
Related
I'm trying to create an app in a different language (in particular Tamil). I've just used Tamil text in the places where I'd use strings and the text renders correctly for newer device simulators (I've tested on API 16 and above). However, when I try running on a simulator with API 10, then I just get rectangles in place of characters. How can I get the text to render correctly on these older devices too?
Did you put it in correct res folder? If your app is supporting multiple language, you must have multiple 'values-xx' in your res folder. For example, if your app supports telugu, you need to create 'values-te' folder with strings.xml inside that folder and put your tamil translation in that file. And you also need to have proper font to render. You can check on your device settings > languages and input > language. See if there any preferred language that you're looking for. If not, you need to provide your own fonts in your app.
You can refer your issue here, and also Android Documentation on how to properly handle multiple languages.
how to show kannada text on older devices.
I have tried with font files but rendering is not correct.
I have tried indic text renderer but I was stuck at
SharedLibrary : libcomplex-script-rendering.so
C:/users/vamsikrishna.g/Downloads/indic-text-renderer-72ba1d4f4f36/obj/local/armeabi/objs/complex-script-rendering/complex-script-rendering.o: In function `Java_org_iisc_mile_indictext_android_EditIndicText_drawIndicText':
C:/users/vamsikrishna.g/Downloads/indic-text-renderer-72ba1d4f4f36/jni/complex-script-rendering.c:136: undefined reference to `hb_ft_font_create'
I was not able to resolve this issue which is experienced by lot of people .
so if any body resolved or has any ideas on rendering kannada text on old Android phones
please help.
Now, far sure it is clear that a TTF file should be present to provide characters and an appropriate libraries (libskia.so or libharfbuzz.so i.e. as an example ) are required to render them correctly.
Replace the firmware of your device with similar Indian region's firmware to render the Kannada font correctly. Other regions' firmware do not render the Kannada fonts correctly. Kannada fonts correctly render on Indian Region's Android version 2.x.
please raise the points if you found this solution feasible,will be thankful to you.
If this is for a particular application:
You need to keep the ttf file in your assests folder and
follow the link...
how to add font in Android Application
this one in for hindi... You can do the same for kannada
I am trying to display text in Indian regional languages on an Android app.
I've set up all the localization folders even though, I just want to have only one language for my app (say Punjabi).
In my strings.xml I have tried putting Hindi characters and Chinese characters and these are displayed correctly on the emulator. But when I put in Punjabi characters nothing shows up on the emulator.
Any reason for this? Can I overcome this problem?
I have the option of using a .ttf file in the assets folder for punjabi font. But that is not what I want to do because it does not give me complete control over the contents being displayed. Each .ttf behaves differently.
Any help is truly appreciated.
There is no support for local Indian languages on Android as yet. Hence the UTF-8 characters that fall outside the acceptable range for Android are ignored. Hence we see a blank being displayed.
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 :)
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");