RFR: 8167268: StandardGlyphVector.getGlyphMetrics creates metrics with erroneous bounds for characters with no outline (e.g., the space character ' ') [v2]

Sergey Bylokhov serb at openjdk.org
Wed Oct 1 18:43:41 UTC 2025


On Tue, 30 Sep 2025 20:08:37 GMT, Daniel Gredler <dgredler at openjdk.org> wrote:

>> src/java.desktop/share/classes/sun/font/StandardGlyphVector.java line 611:
>> 
>>> 609: 
>>> 610:         Rectangle2D vb = getGlyphVisualBounds(ix).getBounds2D();
>>> 611:         if (!vb.isEmpty()) {
>> 
>> Just to double check: do we want to skip glyphs only when the bounds are empty, or we also want to skip them when the bounds are flipped (negative width/height)?
>
> Do you know when that might happen? This code gets its values (after a few layers of abstraction) from `StandardGlyphVector$GlyphStrike.getGlyphOutlineBounds(int, float, float)`, which has a similar `isEmpty` check.

I am not sure if it is possible, but I would like to make sure we did not introduce any issues, since isEmpty() will skip ‘flipped’ bounds.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27580#discussion_r2395509254


More information about the client-libs-dev mailing list