<Swing Dev> RFR: 8231286: HTML font size too large with high-DPI scaling and W3C_LENGTH_UNITS [v4]
Alexey Ivanov
aivanov at openjdk.java.net
Mon Feb 1 22:59:40 UTC 2021
On Mon, 1 Feb 2021 12:06:16 GMT, Matthias Perktold <github.com+7334069+mperktold at openjdk.org> wrote:
>
>
> > As for px, CSS defines, “1px is equal to 0.75pt”, then 1pt is 4/3px — this is where 1.3f comes from (=96/72).
>
> This makes sense.
>
> What makes me wonder is why the length mappings for `px` and `pt` without `W3C_LENGTH_UNITS` are exactly the opposite. In particular, it means that with W3C, `1pt > 1px`, while without W3C `1px > 1pt`.
> That seems odd.
>
> On the other hand, I don't know what the goal of those length mappings is, and they are not the sope of this PR.
It's for historical reasons, I believe. JDK considers 1pt = 1px, as if the default screen resolution was 72dpi rather than 96dpi.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2256
More information about the swing-dev
mailing list