问题
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:
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.
来源:https://stackoverflow.com/questions/3832935/lwuit-issue-in-showing-arabic-words