Comment #5 on issue 191 by Disabling FRACTIONAL_METRICS on Windows yields incorrect bounds for text PSwing components

Here's a summary of this issue to date:

While the default for all platforms seems to be FRACTIONAL_METRICS_ON ("fm_on"), Piccolo2D explicitly sets FRACTIONAL_METRICS_OFF ("fm_off") for painting of PSwing nodes. As I understand it, this decision has been a part of the PSwing class for a long while now and the primary motivation for doing this is to avoid rendering of ellipses on Mac OS X platforms (by using "fm_off", we prevent Mac OS from rendering ellipses for some text renderings that, due to fractional metrics calculations can't fully render within their bounds.)

After running several tests, however, it seems that painting w/ "fm_off" causes more unpleasant behavior across systems than using the default of "fm_on". On all systems, using "fm_off" causes noticeable jittering while zooming. On Ubuntu/Java4, ellipses are actually rendered in this mode and not in "fm_on". And on Windows 7, using Java4, ellipses are rendered regardless of the setting.

I tested on a subset of {Win7, Snow Leopard, Ubuntu10} x {Java4, Java6} x {FRACTIONAL_METRICS_ON, FRACTIONALMETRICS_OFF} and the outcome images will come soon attached with tell-tale filenames:

| "fm_off" | "fm_on"
Java4: jittering; ellipsed no jitter; ellipsed Java6: jittering slight jittering
Java4: jittering; ellipsed slight jittering Java6 (openjdk): jittering; slight artifacts no jitter; noticeable artifacts
Java6: jittering slight jittering; ellipsed

It appears impossible to avoid ellipse-rendering using RenderingHints. Also, using the default rendering hint "fm_on" yields much better behavior (little or no jittering) otherwise.

It seems clients can avoid ellipses by explicitly setting preferred sizes on their components, so there is a workaround.

With this data, I believe the *correct* route is to use the default "fm_on" rendering hints (which is default on all systems I tested on), which also resolves this issue.

I don't believe we can do this, however, in 1.3.* releases as clients may already rely on this behavior. 1.3.* clients can workaround this issue by overriding paint() behavior (not ideal, I know.)

Looking for P2D developers to comment. My vote is to move this ticket to 2.0 with the plan of removing our use "fm_off" in 2.0.

Piccolo2D Developers Group:

Reply via email to