I don't see any problem in "Swing itself". Where do you see a bug ?
-phil.
On 5/20/20, 8:33 AM, Sergey Bylokhov wrote:
On 5/20/20 7:40 am, Philip Race wrote:
If it is assumed that the component and graphics hints should be the
same, isn't it is a bug that they are different?
You aren't understanding and probably haven't read the bug evaluation.
See the latest comment there from Monday, in short, Swing sets the
AA hint
on the graphics right before drawing the text and unsets it again
right afterwards.
I read it, but still think that this bug is another variation of
8142966, metrics returned
by both methods should be in sync, it means the
JComponent.getFontMetrics should use the
same "default" AA hint, or the g.getFontMetrics() should use proper AA
property
based on "awt.font.desktophints" and/or clientproperty.
I think the proper way to fix it is to change the Swing itself:
- if the L&F support "awt.font.desktophints" then Swing should proper
initialize the graphics of the JComponent
- if the L&F ignore/unsupport "awt.font.desktophints" then
JComponent.getFontMetrics() should ignore AA