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 :)

4

3 回答 3

1

在签出的源代码树中查看 external/skia。这就是skia 图形库,它最终负责字体渲染。

于 2010-01-17T20:43:46.083 回答
1

请记住,这个问题比修改底层图形引擎更复杂。

如果您在 Skia 中应用整形,如果线条的宽度发生变化,您可能会遇到问题(发生在 لا 替换 ل 后跟 ا)。这是因为重塑阿拉伯语也可能会改变字母的顺序,而我看到,Skia 试图被动地处理文本内容。它只是按原样将字母输出到显示设备。

现在更糟糕的问题实际上是在 Android 本身。阿拉伯语/希伯来语需要双向重新定位文本,这在 Android 中非常愚蠢,无法处理非常基本的问题。

更多坏消息?Android 的字体 Droid 不包含阿拉伯语或希伯来语字形。除非我们根设备并用另一种字体替换它,否则会显示正方形而不是阿拉伯字母:)

整个平台还远远不能应对任何 RTL 语言,尤其是阿拉伯语。

如您所见,对 RTL 语言的正确修改不仅在 Skia 中......

于 2010-03-05T17:17:00.607 回答
0

看看这是否有帮助:

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

于 2010-01-16T00:11:52.497 回答