Skip to main content

Launching the project 'i18nWidgets for Android'

A lot of Android devices, platforms and apps have several issues regarding rendering of non-English text especially that of Indic text. Though many of them claim to support various Indic and other languages, it usually either means that they have a font for that language included or they have some of the native apps supporting all these languages. But this does not mean all the app will be able to render the non-English text properly. This usually happens for one of the following problem being present:

1. No fonts added in the device (or the native android system)
2. Fonts are not accessible by the third party application
3. App has its own Unicode font, but the native android system does not support text layout rendering for the language
4. App has the font and the android system also supports the language, but the sdk for the particular platform does not have widgets integrated with the complex text rendering features.

This problem gave birth to the idea of developing and extending android widgets which will be integrated with text layout and rendering system on their own. So that, the apps that make use of these widgets will have their own independent rendering system free from the underlying bugs and limitations of the base android system.

The good part is, we do not need to rewrite those rendering systems. The two very well known projects that we need to make use of are Harfbuzz and Freetype. Harfbuzz for text layout of the complex scripts, and Freetype for drawing the font glyphs. 

So, this is what the project 'i18nWidgets for Android' is, under which we are developing independent widgets for app development which will have their own complex text rendering support through integration with freetype and harfbuzz libraries.



The project tree is already made suitable for using with eclipse and hence is readily testable from within eclipse. There are three dependencies to take care of while building:
1. Andoroid SDK 14/15: You may have to configure your development environment for Android SDK 14/15 
2. Android NDK 8: Make sure to have NDK 8 support enabled. 
3. Also have the appcompat_v7_2 library added properly to the project dependencies. 

Please make sure to have exact sdk and ndk versions setup, as the project includes working with native C/C++ libraries along with android platform and hence may run into tedious binary incompatibility issues if not built with proper resources. I have made best attempt to keep things simple for working within eclipse, but do go through the documentation of above development environment thoroughly if you are new to developing native android apps, in case you are struck at some compilation issue.

The project tree has following important components:
1. /jni : This contains the complex-script-rendering library that integrates Android Java widget with the C/C++ libraries of Harfbuzz and Freetype. The entire source tree of particular working snapshot of HB and FT are given in the repo to avoid any incompatibilities during the compilation. Also their makefiles are tuned to work with the given setup.
2. /src/gujaratirendering : This package contains a widget IndicTextView, an extension to the TextView widget which can render Gujarati text. Currently 
3. /src/com/example/i18nwidgetdemo: This is a demo package for testing the the IndicTextView widget with sample text on a simple app screen with Lohit-Gujarati font.
4. /assets: It contains the Lohit-Gujarati font to be used in the demo app

The library complex-script-rendering is based on the original work from Shiva Kumar, and is enhanced and made more generic. Indeed the attempt is to make it further generic and extendable. 

As of now, the project supports text rendering on app being developed for ICS platform and Gujarati language, but the language is not a necessarily limitation. Its just that I tried it with one language to start with, and this can be easily extended and made flexible for auto-supporting any language on the fly. Currently, one will have to make a small change in the complex-script-rendering.c to support language other than Gujarati and add the font of the respective language.

The objectives of the project are:
1. To further improve the library and the widgets code (may involve a lot of code cleaning to fit the norms)
2. Add support for all the languages, by detecting the language of the running text
3. Add more extended widgets to support complete android SDK
4. Create and maintain different branches supporting different android platforms

As of now the platform supported is Android 4.0.3 ICS. One would argue why support an older revision, but that's exactly where the problem is relevant. As many of the lower end widely used android devices are still to upgrade to the latest version, there are vast number of users still struggling to use their native languages, where as the developers who wish to maintain compatibility with these devices are also struggling while making apps for those users. 

While the language support on android systems and their sdk is continuously improving, there is no reason why an independent, reliable, native lang support cannot be added to the apps with help of widgets developed in such manner. This would only improve the reach of technology to those who are facing the economical and linguistic barriers. 

Comments

Popular posts from this blog

PVR is so wierd!

Yesterday we went second time to a mall bit far from office to complete the earlier failed mission of watching this 3D movie, Clash of the Titans. On ticket counter, we were first told that evening show was house full. Then we asked for a night show, and were told there isn't any show then and the gentleman handed us the pamphlet of all movie schedules. We checked on the nearby digital kiosk and also on the printed schedule to be sure of the show timings. Then went to second counter, and asked the lady for the night show tickets, and without any problem got the tickets for back seats. In fact this show was hardly 20% full, wonder how the evening show became houseful. But the biggest wonder/blunder is yet to come. On the entrance we were stopped for having a laptop bag along with (we had went straight after the office). In spite of having checked the bag, we were not allowed, because laptops were not allowed inside! Then we asked for keeping it at the baggage counter. But then, the...

What is so wrong with Bhagwad Geeta?

Here's a discussion I had with someone over Bhagwad Geeta on TOI forum (Stop reading now if you don't want to go to the end, it may mislead): mukunda (Bengaluru) replies to Siddharth 21 Jul, 2011 02:50 PM Ok,lets read ch 4 verse 13. catur-varnyam maya srstam guna-karma-vibhagasah tasya kartaram api mam viddhy akartaram avyayam "According to the three modes of material nature and the work associated with them, the four divisions of human society are created by Me. And although I am the creator of this system, you should know that I am yet the nondoer, being unchangeable." 1st line"catur-varnyam maya srstam" 4 varnas are created by Me(Paramatma),2nd line "guna-karma-vibhagasah" where the vabhajan\categorization is based on one's guna composition and karma composition. 3rd and 4th line states how He is the non doer and unchangable. Sri Krishna says that each living entity is categorized into one of the 4 varnas based ONLY on their pre...

Would you look through a window or go out and play in open?

Freedom of knowledge has always been worshiped across philosophies and religions all over the world. It has been applicable to the most fields of science and technology. This freedom has helped the growth of science, technology, and benefited the human world in every aspect. When Jonas Salk invented polio vaccine, he said "There is no patent. Could you patent the sun?" He did not try to hide its formula. When you buy a car, nobody stops you from opening its bonnet, fix a few problems, do a few modifications. That, is the freedom of knowledge, applied throughout the branches of science. But when it comes to software, abruptly, everyone starts hiding the source code, the formula behind it. You would be even denied from making similar kind of products, by means of patents. Some of the readers might have already guessed where I am taking this topic to. [Those who know enough about foss, may skip the following paragraph.] When you buy a software, it is most likely that you would...