Bad font looking

Hi!

I’m displaying messages in my game and I use drawString but I get a bad looking. Even when antialised there is still too much jaggies in my opinion. I’ve tried the TextLayout class but it seems to reproduce the same result.

On the Graphics2D object the font I set is Arial with Font.BOLD and a point size of 30.

The game runs on 640x480x32.

Any help is of course welcome.

Thanks.

Another question:
What is your preferred way of drawing text in Java apart sprite text?

Sprite text is the only way. It’s the fastest way and you can use funky fonts.

(BTW most PCs emit a strange high frequency sound if you draw text with drawString at 6000-12000 fps :o)

It should look fine at 640x480. Do you have a screenshot?

Take a look at Mighty Bubbles: http://www.myjavaserver.com/~theanalogkid/servlets/app/mighty_bubbles.jnlp

You will notice that the loading/init messages have jaggies. Maybe it’s normal since the low resolution: 640x480?

WARNING: that application forces the system into full screen mode with a refresh rate that the monitor may not support (mine doesn’t). I had to recover by pushing the power button and rebooting.

In fact, the game verify that fullscreen mode and display change are supported. Additionally if the requested mode is not supported then the game will be started in windowed mode. If it’s not the case it’s a bug.

Sorry for the inconvenience.

Do you have a webstart log to send me? It would be very useful.

Just one more comment: the game is looking for the best refesh mode available. In summary there is no forced config change.

The mode change is forced in the sense that you don’t give the user the option of staying in windowed mode if full screen mode appears to be available.
In my case you would appear to be selecting a refresh rate which i supported by the display adapter, but not by the monitor. This causes the monitor to shut down. If I look in the display control panel applet, the supported refresh rates for the monitor are correct.
Unfortunately I don’t know a key stroke which will exit the application so I can return to normal operation (and thus see any log).

I tried it and it said the jar was corrupted

[quote]I tried it and it said the jar was corrupted
[/quote]
I’ve just tried it on my machine by removing the game first from the cache it worked fine. Clear the webstart cache and retry it.

See post http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=Announcements;action=display;num=1090515469
for info on the game.

Hmm. It does look jagged. Perhaps it’s scaled more than the truetype font supports? Dunno if this info is in TTF fonts, but in my word processing app I can only select certain sizes for certain fonts. Perhaps that’s it?

Oh yeah. Runs like a charm on my IBook with OS X :slight_smile:

[quote]Perhaps it’s scaled more than the truetype font supports?
[/quote]
Hum! Let’s give it a try! :slight_smile:

[quote]Oh yeah. Runs like a charm on my IBook with OS X
[/quote]
Cool! :smiley: What fps did you get and was it running in full screen mode?

Well it runs on my home machine, but the text during initialising is only there for a second or so. Hardly enough time to check for jaggies. The instruction text seems fine.
You don’t allow exit (esc) until after ‘S’ starts the game.

[quote] You don’t allow exit (esc) until after ‘S’ starts the game.
[/quote]
Hummm this will get fixed.

On my G3 900 mhz IBook with 256 megs ram it runs at 12-14 fps in fullscreen. Don’t be sad. It’s due to the non-accelerated java display functions on OS X. It’s quite playable though :slight_smile: