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

Phil Race prr at openjdk.org
Thu Dec 11 01:03:32 UTC 2025


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

>> `GlyphMetrics` objects returned by `StandardGlyphVector.getGlyphMetrics(int)` contain bounds that are calculated by taking the glyph’s visual bounds and normalizing them by subtracting the glyph’s position.
>> 
>> However, some glyphs (e.g., the glyph for the space character) do not have visual bounds. Their outline is an empty shape. In such a case the bounds in the metrics should not be normalized by the glyph’s position. The code erroneously ignores this special case, thus producing bounds with inconsistent negative x-positions.
>
> Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Split long line

I don't know how I overlooked this bug report all this time.

I've run all our tests and looks good. Approved.

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

Marked as reviewed by prr (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/27580#pullrequestreview-3565196980


More information about the client-libs-dev mailing list