Where exactly in the Android OS is text renderred?
Asked Answered
B

3

7

Let me first state what I am trying to achieve:

To create a patch for the Android OS to enable it to display Arabic/Hebrew correctly. Both of these languages are Right-to-Left (RTL) and their script involves connected letters/glyphs (unlike Latin alphabets which have discrete letters).

Example:

The Arabic word for "car" is:

سيارة

The discrete letters look like this:

س ي ا ر ة

As you can see, each letter connects to each other letter in different ways depending on what precedes it & what follows it. Ok, enough with the language lessons :) My question is:

What binary/class in android do I need to hijack to enable this functionality?

Another way to put it is; if you wanted every instance "x" to be displayed as "y", system-wide, what binary/class would you need to meddle with?

The source code is browsable at GitHub: http://github.com/android/

I think it might be somewhere under the C/C++ platform_system_core, or thier custom JVM platfom_dalvik.

Just to be clear, the font is not an issue since you can drop Arabic/Hebrew fonts as fall-back fonts and they would display, albeit in discrete form.

Your help would be much appreciated :)

Blindstory answered 15/1, 2010 at 23:52 Comment(0)
P
1

see external/skia in a checked-out source tree. that's the skia graphics library, and that's ultimately responsible for font rendering.

Photojournalism answered 17/1, 2010 at 20:43 Comment(0)
P
1

Remember that the problem is more complicated than modifying the underlying graphics engine.

If you apply reshaping in Skia, you might run into problems if lines' widths change (happens when لا replaces ل followed by ا). This is because reshaping arabic might change the sequence of letters as well and Skia, as I see, tries to act passively regarding contents of text. It simply outputs the letters to the the display device as-are.

Now the worse problem is actually in Android itself. Arabic/Hebrew requires BiDi repositioning of text, which is very dumb in Android and can't handle very basic issues.

More bad news? Android's font, Droid, doesn't contain Arabic or Hebrew glyphs. Unless we root the device and replace it with another font, squares are displayed instead of arabic letters :)

The whole platform is still far from being able to cope with any RTL language, especially Arabic.

As you see, a correct modification for RTL languages isn't only in Skia ....

Pathogenic answered 5/3, 2010 at 17:17 Comment(0)
D
0

See if this helps:

http://blog.amr-gawish.com/39/arabic-language-in-android/

Dehydrogenate answered 16/1, 2010 at 0:11 Comment(3)
Thanks for the help. The link that you provided will render the text correctly within an application, it is part of the solution though. I want to implement this at the system level - so that it renders correctly BEFORE reaching or AFTER departing any application calls.Blindstory
Wow!!.. When you do that, please comeback and post your own answer would you? It sounds tremendously interestingDehydrogenate
This involves modifying platform/base.git package, effectively recompiling most of the Android system. The results is practically a mod of the Android system (like CyanogenMod), unless you do know what jar libraries to replace.Pathogenic

© 2022 - 2024 — McMap. All rights reserved.