Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

At higher scaling, font gets unusually bigger and alignment also got distorted #1819

Open
deepika-u opened this issue Feb 10, 2025 · 3 comments

Comments

@deepika-u
Copy link
Contributor

deepika-u commented Feb 10, 2025

Describe the bug
I see 2 minor problems.

  • the alignment got distorted in section 3.
  • the font became unusually bigger from 175% and above resolution.
    reference screenshots are attached indetail in the doc =>

Hi-DPI_changes.docx

To Reproduce
Run the Snippet367 at 175% or 200% resolution, you see the 2 problems reported.

Expected behavior
Behavior should be same as 100% or 125% or 150%.

Screenshots
Attached in the doc.

Environment:

  1. Select the platform(s) on which the behavior is seen:
    • All OS
    • Windows
    • Linux
    • macOS

Version since
Tried on this version
Eclipse SDK
Version: 2025-03 (4.35)
Build id: I20250209-1800
OS: Windows 11, v.10.0, x86_64 / win32
Java vendor: Eclipse Adoptium
Java runtime version: 22.0.2+9
Java version: 22.0.2

Workaround (or) Additional context
Not aware of.

@HeikoKlare
Copy link
Contributor

At least the font size is expected behavior when running SWT with default settings (i.e., swt.autoScale=integer200), isn't it? When you start the snippet with -Dswt.autoScale=quarter, it will probably show the results you expect, but that's not how SWT behaves by default.

@akoch-yatta
Copy link
Contributor

I'm not sure. Didn't have a look at the snippet yet, but shouldn't be there font still everywhere the same size? I will have a short look later to get in impression about it.

@HeikoKlare
Copy link
Contributor

Taking a look at the screenshots, the font size is only changed in line "4. Painted image (multi-res, zoomed paint)". And this "zoomed paint" explicitly changes the font size:

FontData fontData = gc.getFont ().getFontData ()[0];
fontData.setHeight (fontData.getHeight ()*f);
Font font = new Font (gc.getDevice (), fontData);
try {
gc.setFont (font);

The scale factor used here will be 1 for 100%-150% and 2 for 175% and above. That's why I would expect this behavior. But maybe I miss something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants