Antialiased fonts

By default, anti-aliasing is disabled for better performance. This is not so noticeable until you start transforming images or using fonts in perspective. To activate anti-aliasing (and a good interpolation method), set the rendering hints in the Graphics2D object you are using.

 Graphics2D g=(Graphics2D) bi.getGraphics();
 g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
 g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

Comments? Corrections? Contact us or Login to edit pages directly (registration is free and takes less than displaying a JLabel)
  howto/antialiased_fonts.txt · Last modified: 2005/02/14 10:54
Recent changes | RSS changes | Table of contents | News Archive | Terms And Conditions | Register