Is there any possibility to adjust font smoothing in Java swing application?
Here's some comparison:
The difference isn't huge, but if you look close enough, Adobe Story (and lot of other Flash applications) has stronger and nicer smoothing.
I write text editor in Java, and I would like to achieve such smoothing in my application on JTextPane and JLabels.
Depending on what Object you use to display your Text you need to make a custom one of it and Overwrite the method that is responsible for painting your Text
Here is an example of a custom JTextArea
public class CustomTextArea extends JTextArea {
@Override
public void paintComponent(Graphics g) {
Graphics2D g2 = (Graphics2D) g.create();
g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
super.paint(g);
}
}
You may need to modify it some more but thats the basic concept
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With