Patrick Murris from the NASA World Wind Java project has indicated some
potential issues with bi-directional text and the TextRenderer:
I keep throwing foreign text from Wikipedia into the text renderer, and i'm
still wondering exactly what the application should handle and what does the
text renderer takes care of.
I must admit i am not very familiar with the subject of ltr vs rtl text
direction and such... not mentioning top to bottom. Still, looking at some
arabic text - and looking hard to follow the glyphs... i can tell there are some
ltr-rtl fighting in there - see screenshot (and look at both the textbox on the
left and the main text display over the globe).
My current Locale is french... i'm using arial, and i didnt try to switch
locales for text rendering either.
I can fairly imagine the application would have to handle (or know) whether the
text direction should be ltr or rtl and decide the text left/right edge location
accordingly. Then the text renderer should draw from the given x,y in the proper
direction. Is that the way it is supposed to work ? If yes, then how does the
application knows the proper text direction for a given text string ?
The attached screen shot is an example.
I am not sure there is an issue here. The Swing JTextArea requires a
ComponentOrientation to get its text to render in the correct direction. The
JOGL TextRenderer should handle, and appears to be handling, combined
right-to-left and left-to-right glyphs on the same line correctly.