RFR: 8339974: Graphics2D.drawString doesn't always work with Font derived from AffineTransform [v2]

Phil Race prr at openjdk.org
Mon Oct 7 20:05:34 UTC 2024


On Mon, 7 Oct 2024 18:11:42 GMT, Daniel Gredler <duke at openjdk.org> wrote:

> > Perhaps you can add some extra tolerance and print out the values that caused the failure
> 
> Done.
> 
> I noticed that your test failure was for scale 1, i.e. the smallest text size tested -- so I added 1 to the allowed variance (a fairly large % increase at this small size; text height at this scale is 6 pixels on my Linux box).
> 
> > I will create a special test task that just runs your 2 tests and submit it a large number of times and see if I can
> > get a better feel for it.
> 
> Sounds good, let me know what you find.

The upshot was that the test failed every time on windows 64.
I will try your new tolerance.

May I suggest the following be added to the first test
 diff RotatedScaledFontTest.java.orig RotatedScaledFontTest.java
45a46,52
>     private static void saveImage(String name, BufferedImage image) {
>         try {
>             javax.imageio.ImageIO.write(image, "png", new java.io.File(name + ".png"));
>         } catch (Exception e) {
>         }
>     }
> 
65a73
>                     saveImage("bounds", image);
71a80
>                     saveImage("orientation", image);
77a87
>                     saveImage("xedge", image);
82a93
>                     saveImage("yedge", image);

Visualisation can help although probably it'll be an empty image in most cases that it fails.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/20993#issuecomment-2397784377


More information about the client-libs-dev mailing list