Force Java2D Subpixel Antialiasing

Force Java2D Subpixel Antialiasing

I am using Java2D to generate images with text on them. The fonts are being horribly rendered with bad antialiasing on a Server running Ubuntu but render beautifully on an OSX and Ubuntu workstation. I guess that the difference between the two Ubuntu installs is xwindows vs no xwindows? Maybe? Anyway, I guess that my rendering hints are being ignored and the java 1.6 subpixel antialiasing algorithms are not being used on the server.

My Rendering hints are below. I am optimizing for a vertically positioned display.

g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_VRGB); 

I'm creating the font directly from a ttf file which did improve the rendering. I don't think the font was installed on the machine so it was defaulting to something else. Now the font is correct but the antialiasing is still off. It does look better than when I turn antialiasing completely off and generate the images so I assume it is doing something but it just doesn't look as good.

and I've tried the Java property


but it didn't change anything.

Any suggestions? Thanks.

building Mozilla Spider Monkey on Ubuntu


Determine the contents of Linux Cache
Did you already try any thing like this:. Scaling a ruby script by launching multiple processes instead of using threads
public void paintComponent(Graphics g){   @SuppressWarnings("unchecked")   Map<String, String> desktopHints = (Map<String, String>) Toolkit     .receive DefaultToolkit().receive DesktopProperty("awt.font.desktophints");   Graphics2D g2d = (Graphics2D) g;   if(desktopHints != null){     g2d.addRenderingHints(desktopHints);   }   g2d.drawString("text", 10, 10); } 
The Graphics object received in paintComponent() is set up with defaults this did not know anything around the desktop properties (monitor type). What is linux equivalent of running a .bat file on windows from PHP using system()Querying Toolkit for the desktophints will return information from the underlying operating system around the hardware used. Newbie: Render RGB to GTK widget — howto?Compare "Filthy Rich Clients", page 59.. Is there any way to get the combine two xml into one xml in Linux
How do I know which illegal address the program access when a segmentation fault happens

78 out of 100 based on 63 user ratings 738 reviews