I just created a text page in my app and now i want to change language of this page dynamically
to Indian languages like Telugu, Tamil, Bengla, Guujrati and Punjabi.
I researched a lot, and got that there are only 2 methods to achieve this(please correct me if i am going wrong):-
1)Using localization of strings http://developer.android.com/guide/topics/resources/localization.html .
But in it problem is that, if android phone is supportable with these languages then it works
otherwise it show boxes in-place of fonts.
2)Using custom fonts to change language like
TextView tv=(TextView)findViewById(R.id.custom);
Typeface face=Typeface.createFromAsset(getAssets(),"fonts/Verdana.ttf");
tv.setTypeface(face);
But here's the problem is rendering. Fonts are not rendered properly.
Please suggest me, which option should i choose and how to overcome it's limitation.
I also want to mention that I want to support it on Android 2.3 and above.
Prior to Android 3, you need to use an appropriate font plus localisation to display characters from special scripts.
For Android 3+, using localisation most times is sufficient. Exceptions are Arabic, Hebrew, Indic scripts and a few others where you may need an appropriate font in addition to localisation to properly display these special characters in your Android app.
AFAIK, Verdana ONLY supports European Scripts such as Latin-1, Latin Extended-A, Latin Extended-B, Latin Extended Additional, Basic Greek and Cyrillic. Whereas Telugu, Tamil, Bengali, Gujarati are part of the South Asian Scripts - not sure about Punjabi (See Unicode Consortium for more info regarding Unicode scripts.) I guess you need to find an open-source font (so you don't have to pay loyalty when using proprietary fonts) that support the scripts you want to implement in your app.
Related
I am writing an app in which I have to support all Indian languages and for that I am looking for some third party library (free or paid)
I googled many times for the same but I did not get any decent option (library)
I just got use strings.xml for (English, Hindi) in their respective folders.
But I have seen in Whatsapp there is a multilanguage option, which supports almost all major indian languages
For an Example : If I do select Hindi language, so it translates complete app in Hindi language only
Same kind of functionality, I need in my app, like in drop down, If user do tap on any of the Indian language, my app has to converted in same one only (Like: Hindi, Telugu, Marathi, Gujarati and others)
What would be the best way of doing this and getting it done?
It depends what do you mean by "support"
Android supports all Indic languages. But it is not localized in all them.
Because of that, some of them cannot be selected from Settings.
But if you can provide string.xml files for all of them, and put them in the proper values-xy folder.
Possible problems:
How to select a language that the OS does not support? Have your own language selection. Once a locale is selected, call Locale.setDefault (to change the formatters), and change the resource loading configuration (Set Locale programmatically)
You see squares. This means missing fonts. Android has fonts for all the Indic scripts. But older phones might miss some. And OEMs might remove some to reduce size. So you can embed the proper Noto fonts in your application and use them (https://www.google.com/get/noto/). Use styles, and have language specific style sheets.
Keyboard missing. Install one. Here is the Google one: https://play.google.com/store/apps/details?id=com.google.android.apps.inputmethod.hindi. But there are also third party ones, for instance https://play.google.com/store/apps/details?id=org.smc.inputmethod.indic
i am using arabic characters for the first time in my app
this is how they should look like :
But this is how they end up :
things i tried:
changed the phone language to arabic.
i chose this font :Arabic type settings. i found in the fonts list
things works well for windows, its only in Android i get the problem.
i believe i am missing something because i never used arabic in apps before.
i appreciate your help.
Fire Monkey does not support right-to-left languages like Arabic. Unfortunately your chosen framework is not capable of meeting your needs. You will need to find a different tool to write your app.
My learning app requires displaying Korean, English and Chinese. One solution I have is to embed a Korean/English font and a Chinese font. Then put together a string with different TextFormats.
The thing is, I'm positive that IOS and Android devices should contain native Chinese, Korean and English fonts already, and I'd much rather refer to and use those fonts instead of packing them.
I tried detecting fonts by using Font.enumerateFonts(true), but when I use font.hasGlyphs('你'), I don't get a true, or anything, so I don't know how to choose the proper device font.
If that doesn't work, is there a font that contains all of those Characters? Or maybe a font-builder program that'd allow me to customize a font to include
This was something that I wrote sometime back
http://blogs.adobe.com/airodynamics/2012/08/21/supporting-languages-with-unicode-characters/
Hopefully it helps you
You can always know the name of font specific to the language. May be this http://support.apple.com/kb/HT5878.
Now based on the language you want to show just change the value of font in the statement format.font and the correct language should come up.
I have seen lot of questions regarding this issue.I think from myside I have tried everything to make it works and it works but not as coustomer expects. let me explain everything.
here is the compatibility of my android application
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
this means minimum version is 2.2. Arabi is supported in 2.2 and I have use Farsi class.
How to support Arabic text in Android?
Apartfrom that I have used arabic fonts DroidNaskhBold.ttf
Herewith I have attached a screen shot of arabic words. http://tinypic.com/r/e8u1zd/6
I dont know Arabic. But when I check letter by letter I noticed that after adding above font some letters are replaced by some different letters.
Other font I used don't show arabic words properly. I mean they are not show together accumelated.I can not keep hope on other fonts.
Is there way to solve this issue? If there is a good font to render Arabic text properly, I am ready to buy it because I think this is the only way to have a hope on this.
I do not see any problem in this font, it does not seem to change any letter, just you need to use library to connect the letters such as Better Arabic Reshaper
you can find different Arabic fonts here and here, but again I believe the problem is not in the font, but in the library you are using to connect the letters.
You can use API 17 , Android 4.2 which is Ok with RTL languages
Download Farsi class and add it in your project. Then if you want to write any arabic text on a button do:
Typeface tfbtn = Farsi.GetFarsiFont(this);
Button ed_companies_username=(Button)findViewById(R.id.add_companies_send);
ed_companies_username.setTypeface(tfbtn);
ed_companies_username.setHint(Farsi.Convert("ادخل اسمك"));
I have a website specifically for viewing on Android devices, I am using Gujarati languages and i have a big problem rendering the Gujarati Fonts properly, I atleast want a workaround to get the Gujarati fonts Working properly which is by default not supported on any Android versions. And so i did,
The Work around:
- Rooting the phone
- Finding the correct unicode font for Gujarati language
- Replace the existing DroidSansFallback.ttf in System/fonts with the Gujarati Font (with some extra changes in fontsfallback.xml in system/etc folder for ICS)
This Helped me to atlest view Gujarati texts, but not correct rendering.
The Problem:
1) Problem of Half forms, the half form letters are not rendering properly as they are suppose to combine but they dont,
If you refer to this faq on unicode.org, it clearly defines how it should render,I have also used the mentioned "Zero Width Joiner" by using html codes for every letter using [unicodeLookup][7] but it has no effect.
Anyways This problem is not primary as it is improper but still not incorrect.
2) This rendering problem makes the texts print incorrectly, See the two images below, First one is correctly render as visible on PC and second on is a screenshot from Android native browser
image
the problem marked as 1 are fist problem and the one marked as 2 are second problem, if you google "Devanagari - Unicode Consortium ch09" you will get a pdf refering to this problem (just goto "Figure 9-8. Rendering Order in Devanagari") which clearly explains the method to render the scripts correctly. It seems what ever android uses to render the scripts is not supported for such languages, if there is any change that can be made to Android OS to render the fonts in correct order, please help.
This is definitely not a problem with fonts as i have tried using Shruti fonts which is used by windows OS, it is a problem with rendering these complex scripts
Possible Solutions: (unwanted)
1) Using opera mini with bitmap fonts (not my solution)
2) Use Images instead of texts (again not my solution as my site will have 300 lines of lists and that too for mobile, do not want to increase page size)
Please give me a proper solution to this problem, thanks in advance !!
Rendering Gujarati (and other "complex" scripts, i.e. those which use half-forms, contextual forms, rearrangement, etc.) requires more than just fonts; it also needs text layout. Text layout capability is normally supplied by the host operating system or in some cases the application. Android has been improving text layout support, but even the latest version is still not complete for all scripts. In other words: you cannot easily fix this with fonts alone, even for recent versions of Android.
Possible workarounds:
develop some kind of plugin or extension that does correct Gujarati layout and require users to download/install the plugin to use your site. This will likely be a very high-impedance path, requiring a great deal of expertise in fonts, software development, and knowledge of the target writing system. Not to mention the inconvenience for your users.
develop a custom version of a Gujarati font and use corresponding custom text in your site that does not require text layout; supply the font via #font-face (webfont). This will also likely be fairly challenging if you do not have experience with font development, but would probably be the best path.
render the text to images; do browser-sniffing and supply images for cases where the client is known not to support complex scripts. This is likely to fail much of the time (hard to keep track of browser capabilities, not to mention the problem of reliably detecting browsers to begin with). But guaranteed to give the right results.
If you want to view your website in all devices just put webfonts in the your website. web fonts are embedded fonts that you put on your server and with proper css link everybody can view that without installing the fonts on devices.
For other websites not having web fonts use firefox for android and then get addon https://addons.mozilla.org/en-us/android/addon/gujarati-fonts-package. Now you can view all webpages in Gujarati fonts without any complex procedure or root the android.