Describe the bug
When using an environment and swt.autoScale configuration that leads to an auto-scaled device zoom that is larger than native zoom, the line heights in a StyledText will become too large (scaled according to device zoom instead of native zoom).
It is a regression as a combination of two PRs:
To Reproduce
The behaviore can probably be reproduced with CustomControlExample's StyledText tab, but it's most simple to do with an Eclipse SDK:
- Set primary monitor zoom to 175%
- Start an Eclipse SDK with disabled monitor-specific scaling (e.g.,
swt.autoScale.updateOnRuntime=false)
- Open any StyledText such as a Java code editor
You will see that line height are slightly to high.
To compare with the intended behavior, you can either enabled monitor-specific scaling or start the application with Dswt.fontRegistry=legacy, as the previously used fixed-zoom font registry worked around that issue.
Expected behavior
The line height to always be correct according to the font size / native zoom.
Screenshots
The left shows a StyledText with the reproduction scenario (175% primary monitor zoom, monitor-specific scaling disabled), the right shows the same StyledText with -Dswt.fontRegistry=legacy leading to the expected behavior:

Environment:
- Select the platform(s) on which the behavior is seen:
Version since
I20250606-1800
Describe the bug
When using an environment and
swt.autoScaleconfiguration that leads to an auto-scaled device zoom that is larger than native zoom, the line heights in a StyledText will become too large (scaled according to device zoom instead of native zoom).It is a regression as a combination of two PRs:
To Reproduce
The behaviore can probably be reproduced with
CustomControlExample'sStyledTexttab, but it's most simple to do with an Eclipse SDK:swt.autoScale.updateOnRuntime=false)You will see that line height are slightly to high.
To compare with the intended behavior, you can either enabled monitor-specific scaling or start the application with
Dswt.fontRegistry=legacy, as the previously used fixed-zoom font registry worked around that issue.Expected behavior
The line height to always be correct according to the font size / native zoom.
Screenshots

The left shows a StyledText with the reproduction scenario (175% primary monitor zoom, monitor-specific scaling disabled), the right shows the same StyledText with
-Dswt.fontRegistry=legacyleading to the expected behavior:Environment:
Version since
I20250606-1800