Font differences between 1.4.2 and 1.5

Font newFont = (Font)loadedFonts.get("microgme.ttf");
Constants.FONT_MENU_SMALL = newFont.deriveFont(20f);

And later…

font = Constants.FONT_MENU_SMALL.deriveFont(Font.BOLD, Constants.FONT_MENU_SMALL.getSize2D() - 3.f);

In Java 1.5 it shows text like this:

http://www.gamelizard.com/images/games/rimscape/textIn1.5.gif

In Java 1.4.2 it shows text like this:

http://www.gamelizard.com/images/games/rimscape/textIn1.4.2.gif

Why is it so different? I want the text to always look like it shows in 1.5. Is there any way I can make them act the same?

it looks like it’s anti-aliased, or possibly using ClearType which wasn’t supported on 1.4…

it seems like they really gave Swing a facelift.

both are anti-aliased. I assume that means it’s the ClearType support you mentioned then

Much of the internals for fonts has been rewritten for 1.5, that’s why. Much are still missing when it comes to quality though. ClearType (I.e. sub-pixel anti aliasing for TFT) is one thing that are missing so it can’t be that.

Cheers,
Mikael Grev

i wouldn’t call that sample of 1.4.2 font anti-aliased, unless it’s really dodgy anti-aliasing… it looks like a smaller version of the font has been resized. no idea how it could be fixed though…

it’s exactly the same code in both cases. The only difference is the Java versions

Well, I asked our fonts guys about this, and the response was basically “Whatever 1.5 is doing is correct” =)

hehe yes it does look much nicer :slight_smile: