demos/j2d/TextFlow (Text Render) demo gives fuzzy text

'm testing demos/j2d/TextFlow and the resulting text is fuzzy. The left side of each letter is not white but rather a light grey and the right side is a dark gray. I guess that this is because the text is not being drawn exactly on a pixel boundary. Why is this? My own code has the same problem. How can I get the nice crisp text shown in the image on http://www.java-gaming.org/forums/index.php?topic=15634.30?

I would like to include a screen capture (6 kb) but I get the error: “The upload folder is full. Please try a smaller file and/or contact an administrator.”

I’m using jogl-1.1.1-rc7-linux-i586

thanks for your help
Stuart

I just tested using jogl-1.1.0-rc2-linux-i586 and see the same thing (the text has light gray pixels on the left and dark grey pixels on the right, check, for example, with xmag).

LD_LIBRARY_PATH=jogl-1.1.0-rc2-linux-i586/lib java -classpath jogl-demos.jar:jogl-demos-util.jar:jogl-1.1.0-rc2-linux-i586/lib/jogl.jar:jogl-1.1.0-rc2-linux-i586/lib/gluegen-rt.jar demos/j2d/TextFlow

I double checked with jogl-1.1.1-rc7-linux-i586, the vertical transitions are always sharp, black to white then white to black, but the horizontal transitions are black, gray, white then white, grey, black. How do I get nice sharp white on black text?

My best guess is that this is something your graphics card is doing wrong. I can’t see these kinds of artifacts on my machine (NVidia Quadro FX Go700 chip – pretty ancient at this point). Perhaps other people will have better suggestions. You can try hacking the source code for the TextRenderer to get it to explicitly disable smoothing on the underlying TextureRenderer, which will cause it to explicitly use the GL_NEAREST texture filter rather than GL_LINEAR.

I have two Intel graphics cards, a Q35 and a 945GM. The artifacts exist on both cards.

Did you check for these artifacts using xmap or another program that magnifies the screen pixels? The shadows are not always very strong.

I added renderer.setSmoothing(false) in getBackingStore.GLTextRenderer and the shadows went away.

You can find some screen dumps at https://jogl.dev.java.net/issues/show_bug.cgi?id=342

I’m trying to get good 12 pixel text.

Stuart

I’ll give this some thought. There are a few additional controls people have expressed a need for.

setSmoothing() / getSmoothing() have been added to the TextRenderer API. This change will show up in tomorrow’s nightly build as well as the forthcoming 1.1.1-rc7.