Swing Font Rendering

喜夏-厌秋 提交于 2019-12-12 16:24:53

问题


I am developing a Java swing Application with a Synth look and feel. The application has a background image that contains some text, and I need some 'active' text (text in a JLabel) above this background layer. However, the font I have chosen (Verdana), renders terribly in Swing for some reason, and as such, the font of the active text does not match the font of the background. Does anyone know of a way to make the text a little smoother-looking in Swing? I have found similar problems here and here, but I'm unsure as to what effect AA has on the rest of the applications images, or whether to use AWT desktop Properties or the -Dswing.aatext=true flag. Any tips would be much appreciated. Thanks!

EDIT: I have tested this in OSX, as well as Windows 7, both exhibit the same effect.


回答1:


This is a problem with Swing itself I believe. Look at the related questions.

Using FontForge to disabling hinting can help in my experience.



来源:https://stackoverflow.com/questions/8402797/swing-font-rendering

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!