On Wed, 30 Sep 2026 07:20:50 GMT, Prasanta Sadhukhan <[email protected]> 
wrote:

>>> But, with DIALOG font instead of MONOSPACED, everything else remaining 
>>> same, it passes in Windows, Linux and even macos (already mentioned here 
>>> [#32742 
>>> (comment)](https://github.com/openjdk/jdk/pull/32742#issuecomment-5633538857))
>>>  so there will be no need of PL-ing the test then..
>> 
>> That's luck. There's a clear product bug. It should be PL'd.
>> 
>>> 
>>> I tried testing by iterating with all available fonts but it fails in 
>>> Windows
>>> 
>>> ```
>>> Testing font=**Arial Black** aa=false, 
>>> graphicsTransform=AffineTransform[[-0.707106781186548, -0.707106781186548, 
>>> 0.0], [0.707106781186548, -0.707106781186548, 0.0]], 
>>> fontTransform=AffineTransform[[1.0, -0.0, 0.0], [0.0, 1.0, 0.0]]
>>> Exception in thread "main" java.lang.RuntimeException: Failed: wrong colors 
>>> at i=0 j= 221 rgb1 java.awt.Color[r=0,g=0,b=0] rgb2 
>>> java.awt.Color[r=0,g=0,b=0]
>>>         at 
>>> DrawRotatedStringUsingRotatedFont.checkColors(DrawRotatedStringUsingRotatedFont.java:135)
>>> ```
>>> 
>>> and in Linux ubuntu 24.04
>>> 
>>> ```
>>> Testing font=**C059 Bold Italic** aa=false, 
>>> graphicsTransform=AffineTransform[[-0.707106781186548, -0.707106781186548, 
>>> 0.0], [0.707106781186548, -0.707106781186548, 0.0]], 
>>> fontTransform=AffineTransform[[1.0, -0.0, 0.0], [0.0, 1.0, 0.0]]
>>> Exception in thread "main" java.lang.RuntimeException: Failed: wrong colors 
>>> at i=0 j= 221 rgb1 java.awt.Color[r=0,g=0,b=0] rgb2 
>>> java.awt.Color[r=0,g=0,b=0]
>>>     at 
>>> DrawRotatedStringUsingRotatedFont.checkColors(DrawRotatedStringUsingRotatedFont.java:135)
>>> ```
>> 
>> I suspect that getPixelBounds will make it pass. As I said off-line, the 
>> union of that and the visual bounds *ought* to cover rounding and 
>> pixelization. If it doesn't there's another product bug to look at.
>
> @prrace Should I update the test iterating "all" fonts and PL-ed on linux and 
> macos 
> or since you mentioned "No, it should work with DIALOG on Windows & Linux. 
> You can revert that change."
> this present PR change is ok?

I think ideally, yes, we should try all fonts.

Using pixel bounds, I find that the "aa=false" cases passes on Ubuntu 26.04, 
but the "aa=true" case can fail with many fonts because - in at least the two 
cases I looked at - there are AA pixels outside the bounds - an off by 1 
problem. Doing the 1 pixel padding you have in the version of the test in the 
PR fixes that. There might be a bug in the code that calculates the pixel 
bounds for the AA case.

If you do both do you still have failures ? If so provide the specifics of the 
fonts that fail.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32742#discussion_r4149485169

Reply via email to