Skip to content

Font size of Line number ruler is different when using swt.autoScale=int200 #2385

@arunjose696

Description

@arunjose696

After the following PR to use ScalingSWTFontRegistry, a regression was introduced where the font sizes of the line number ruler (for int200) differ:

Previously, in LegacySWTFontRegistry (DefaultSWTFontRegistry), fonts were always created using the constructor Font(Device, FontData). However, in ScalingSWTFontRegistry, fonts are now created using the Font(Device, FontData, zoom) constructor.

When fonts are created using Font(Device, FontData), they implicitly use DPIUtil.getNativeDeviceZoom() for scaling. On the other hand, fonts created via the new constructor use the zoom value explicitly passed to SWTFontProvider.getFontHandle(font, zoom).

For example, with LegacySWTFontRegistry, the LineNumberRuler had the same font size as the text editor.
However, with ScalingSWTFontRegistry, the sizes may now differ due to the zoom being explicitly passed on font creation.

(LegacySWTFontRegistry) (ScalingSWTFontRegistry)

Steps to reproduce

Start eclipse On monitor with 225% zoom with

-Dswt.autoScale.updateOnRuntime=false
-Dswt.autoScale=integer200 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions