views:

91

answers:

0

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

-Dawt.useSystemAAFontSettings=lcd

but it didn't change anything.

Any suggestions? Thanks.