RFR: 8337287: Update image in javax.swing.text.Document.insert

Alexey Ivanov aivanov at openjdk.org
Mon Sep 16 19:22:08 UTC 2024


On Sat, 24 Aug 2024 00:11:14 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

> Just curious why the chars are not in the middle of the boxes?

They're aligned according to CSS rules:


            text-anchor: middle;
            dominant-baseline: middle;


The text is positioned in the middle of the box -0.5 pixels.

However, I agree the text looks visually unbalanced. Indeed, at 200% scale and Arial font, there are 4 pixels on top of ‘T’ and ‘h’, but there are 8 pixels on the bottom of ‘q’. If I use Calibri font, the values are 8 and 9 pixels correspondingly. So it depends on the font used. The situation is similar on macOS.

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

PR Comment: https://git.openjdk.org/jdk/pull/20376#issuecomment-2353728939


More information about the client-libs-dev mailing list