问题描述
我正在开发具有Synth外观的Java swing应用程序.该应用程序的背景图像包含一些文本,而我需要在此背景层上方添加一些活动"文本(JLabel中的文本).但是,由于某种原因,我选择的字体(Verdana)在Swing中呈现出可怕的效果,因此,活动文本的字体与背景的字体不匹配.有谁知道一种在Swing中使文本看起来更平滑的方法吗?我在此处和此处,但我不确定AA对其余应用程序图像有何影响使用AWT桌面属性或-Dswing.aatext = true标志.任何提示将不胜感激.谢谢!
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!
我已经在OSX和Windows 7中对此进行了测试,两者都显示出相同的效果.
I have tested this in OSX, as well as Windows 7, both exhibit the same effect.
推荐答案
我相信这是Swing本身的问题.查看相关问题.
This is a problem with Swing itself I believe. Look at the related questions.
使用 FontForge 禁用提示可以对我的经验有所帮助.
Using FontForge to disabling hinting can help in my experience.
这篇关于Swing字体渲染的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!