开发者

Font Problems in Multilingual Java Application

开发者 https://www.devze.com 2023-02-06 06:17 出处:网络
I am developing a multilingual Java application in which I make heavy use of JTextArea. There is an apparent (though not actual) font change to the JTextAreas when non-Latin-based characters are inser

I am developing a multilingual Java application in which I make heavy use of JTextArea. There is an apparent (though not actual) font change to the JTextAreas when non-Latin-based characters are inserted. Furthermore, other characteristics of the JTextArea, such as the tab size, appear to change as well.

The following image shows a JTextArea with a default font (Lucinda Grande) and tab size of 2:

Font Problems in Multilingual Java Application

The following imag开发者_运维技巧e shows what happens to the JTextArea after inserting a line of Hindi text:

Font Problems in Multilingual Java Application

As you can see, the font's appearance as well as the tab size have apparently changed, though when I inspect these properties in a debugger, it is clear they have not. The problem is not limited to Hindi - Arabic text produces the same results, though Korean and Russian text do not. Any Ideas whats going on and if and how I can prevent this?


I believe it has something to do with the Rendering (of course). It seems that antialiasing has now been turned of, maybe because the font is configured to not support it. I would investigate in this direction.

0

精彩评论

暂无评论...
验证码 换一张
取 消