Mixing Arabic and English causes problems in JTextArea (Java)

I have a JTextArea that renders the HTML pages of an Arabic website. So it's essentially a mixture of English and Arabic. In the JTextArea, with the columns set to 30, certain text just disappears rather than wrapping correctly. The weird thing is that if I copy the invisible text and paste it into notepad, I see it in Notepad. If I change the number of columns to 40 everything looks fine. Any ideas?

+1


source to share


2 answers


See this screenshot of the problem:

http://i.stack.imgur.com/lErjB.jpg



Eli, thanks for the answer. Not sure if I explained the problem correctly. On the left of the screenshot is the JTextArea. On the right is a selection from a JTextArea pasted into Notepad. Does it mean more now?

+1


source


Is this the 30th character to disappear? Due to the script, it is possible that the JTextArea cannot display Arabic characters correctly. So it counts the characters correctly, but doesn't realize they are taking up more space. Support for such fonts is not great, so you can write your own renderer for your JTextArea to handle this (so you can manually account for enough space required for each Arabic character and adjust line breaks accordingly).



0


source







All Articles