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 <jdowl...@redhat.com> Senior Software Engineer, OpenJDK, Red Hat