<Swing Dev> [10] RFR JDK-8178025:HiDPI with non-integer scale factor - SPANs in HTML are rendered overlapping each other
Sergey Bylokhov
Sergey.Bylokhov at oracle.com
Sat Oct 14 01:10:17 UTC 2017
Hi, Prasanta.
On 11/10/2017 02:43, Prasanta Sadhukhan wrote:
> Issue was, when a JLabel with an html text is created, the
> GlyphPainter1.getSpan() uses a FontrenderedContext with transform scale 1
> and also the obtained width is converted to int and not to float.
Probably this is a root cause of the bug? FontrenderedContext is an
abstraction which encapsulate information about text attributes for some
specific surface such as screen, window, etc. If the label or any other
components will use some FRC for rendering then the same FRC should be
used for font size measurement. So why the scale is 1?
> Proposed fix is to use correct transform while calculating the string
> width and also use floating point API to get floating point width.
It will apply the screens scale to the FRC even if the component is
located on some other screen.
--
Best regards, Sergey.
More information about the swing-dev
mailing list