[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    requesting an AWT expert prior to backporting 8304350 (Font.getStringBounds calculates wrong width f
From:       Jonathan Dowland <jdowland () redhat ! com>
Date:       2023-04-28 12:23:51
Message-ID: 20230428122351.v2hdbvmnr62szqbq () coil
[Download RAW message or body]

Hi folks,

We were made aware of a problem with java.awt.Font bounding box
calculations when custom font Tracking properties were specified and
raised a JBS bug (<https://bugs.openjdk.org/browse/JDK-8304350>). I am
not an expert on this area of the JDK, but upon investigation it seems
the routine java.awt.Font.getStringBounds uses a heuristic to determine
whether calculating the bounding box is "simple" or not. Our case was
falling into the simple branch. Our initial proposed fix was to adjust
the heuristic such that custom Tracking properties went down the
"complex" path, which is correct, but likely slower.

Our initial fix was merged into JDK21. Ultimately we plan to propose
backporting this to JDK 11 Updates (via 20 and 17 Updates). But before
we start that, we would really appreciate it if someone with better
familiarity with the AWT or Font code could indicate that they were
happy with this.

In particular, another approach could be to modify the "simple" path
delegate sun.font.FontDesignMetrics to account for the Tracking
property. My take, upon reading it, was this was probably not
appropriate, but I'm new to this code and would love to have the
opinion of someone more expert.


Many thanks for your time,

-- 
👱🏻 Jonathan Dowland <jdowland@redhat.com>
Senior Software Engineer, OpenJDK, Red Hat

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic