Instability of texts in Graphics2D imaging (original) (raw)

Herve Girod herve.girod at gmail.com
Wed Mar 14 17🔞58 PDT 2012


Hello,

I don't know if it's the right place to post this, but in one of our applications we have a strange problem with texts when drawing Java2D images. Basically it is an application which draws a Graphics2D image with a rotation, the rotation quickly changing with time.

There is s strange effect with characters when they rotate: it appears as if each character "was rotated seperately", there is a small discrepancy between the various characters of each String (they appear to lose their alignment during the movement, then they seem to realign), as if their position were computed separately or at different times. However, each String is rendered using the standard drawString method of the Graphics2D class.

First we thought it could have been because of of the rendering hints we used, but we already used some of them (including antialiasing), and this effect does  not disappear even after setting various options (for example:  VALUE_FRACTIONALMETRICS_ON, VALUE_RENDER_QUALITY, VALUE_STROKE_PURE, VALUE_TEXT_ANTIALIAS_ON).

The particularity of our use case is that :

My main question is: do I need to check closely our app to hunt for a problem in our part, or is it possible that this behavior may be linked to how Java draws Strings?

Regards,

Herve Girod



More information about the awt-dev mailing list