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. 

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…

Unicode 5.1 release and Indic changes

Unicode 5.1 release was announced earlier this month on 4th April. Here I have put a diff taken of Unicode 5.1 character database against that of Unicode 5.0. My buddy, Parag also did a nice job of summarizing the Indic specific changes, that I am trying to restate now.
So, here go the updates on Indian scripts UCD:

A. New Indic Scripts Added to Unicode:

1. LEPCHA:

Lepcha is a language spoken by the Lepcha people in Sikkim in India,and parts of Nepal and Bhutan. The Lepcha script (also known as "róng") is a syllabic script which has a lot of special marks and requires ligatures. Its genealogy is unclear. Early Lepcha manuscripts were written vertically, a sign of Chinese influence. Lepcha is considered to be one of the aboriginal languages of the area in which it is spoken. Total number of speakers numbers near 50,000. Unicode Range =>U1C00 to U1C4F Chart URL => http://www.unicode.org/charts/PDF/U1C00.pdf

2. OL-CHIKI:

The Ol Chiki script, also known as Ol Ce…