Search code examples
javaswtright-to-leftbidi

Bidirectional multilanguage String conversation


Im trying to print a bidi String using SWT,Paperclips and Java. When I Print the String to the screen - everything is OK (on Java-SWT label) But when I try to print it with paperclips the String is mixed up.

This is what I want to get: the way the screen should be

thie is what I get: the way it is
It looks like the RTL/LTR parts are reversed. since I have no API to define the string as RTL (on paperclips) how can I do a transformation to the string so it looks ok on paperclips?

BTW, paperclips is an open-source printing support for swt. but as far as I understand this issue is not an paper clips issue but more bidi/string conversations issue.


Solution

  • If you have no other way to specify that the control is RTL, you can try putting the RLE character (U+202B) in the beginning and the PDF character (U+202C) in the end.

    Note that it will not necessarily work, because I'm not sure that SWT supports these characters. Also, if somebody copies that text, it will probably be copied with those control characters.