LWUIT : issue in showing arabic words ?

2019-08-19 03:23发布

Hi i have problam in showing arabic words in LWUIT , the arabic words characters are separated and reversed , but it`s work true on nokia , how can i slove this problem ? thanks

1条回答
欢心
2楼-- · 2019-08-19 03:53

In bitmap fonts Arabic glyph shaping doesn't work because of the unique properties of the language. You need to use system fonts (which aren't the default in some of LWUIT's themes), in system fonts support for Arabic is up to the device/simulator not all of which support bidi/shaping properly.

Notice some older Sony Erricson devices as well as some other devices such as badly localized Android devices (e.g. Nexus One) don't have proper bidi support. This means their native widgets implement bidi instead of their drawString implementation. Unfortunately there is no way to detect this bug in runtime, so LWUIT can't seamlessly workaround it!

The only solution is to create a version specifically to such devices which manually performs the bidi algorithm on the drawString code, this means replacing the implementation for those devices with an implementation that just overrides the drawString method and performs the bidi algorithm on rendered strings. LWUIT's bidi algorithm is exposed in the Display class.

查看更多
登录 后发表回答