Skip to content

Conversation

@arunjose696
Copy link
Contributor

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)
When DPIUtil.getNativeDeviceZoom() is not equal to passed zoom wrong font sizes occur.

This PR contains two commits.

The first commit is the same as first commit of #2377
This should be merged only after #2377

Fixes #2385

@arunjose696 arunjose696 marked this pull request as ready for review August 6, 2025 10:02
@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

Test Results

   546 files  ±0     546 suites  ±0   28m 52s ⏱️ -41s
 4 424 tests  - 1   4 407 ✅  - 1   17 💤 ±0  0 ❌ ±0 
16 745 runs   - 1  16 618 ✅  - 1  127 💤 ±0  0 ❌ ±0 

Results for commit 08653e1. ± Comparison against base commit 20d18aa.

This pull request removes 7 and adds 6 tests. Note that renamed tests count towards both.
org.eclipse.swt.internal.LegacySWTFontRegistryTests ‑ fontsAlwaysDependOnPrimaryZoom
org.eclipse.swt.internal.LegacySWTFontRegistryTests ‑ fontsAreCached
org.eclipse.swt.internal.LegacySWTFontRegistryTests ‑ systemFontsAlwaysDependOnPrimaryZoom
org.eclipse.swt.internal.LegacySWTFontRegistryTests ‑ systemFontsAreCached
org.eclipse.swt.widgets.ControlWin32Tests ‑ testDoNotScaleFontInNoAutoScaleScenarioWithLegacyFontRegistry
org.eclipse.swt.widgets.ControlWin32Tests ‑ testScaleFontCorrectlyInAutoScaleScenario
org.eclipse.swt.widgets.ControlWin32Tests ‑ testScaleFontCorrectlyInNoAutoScaleScenario
org.eclipse.swt.internal.DefaultSWTFontRegistryTests ‑ fontsAlwaysDependOnPrimaryZoom
org.eclipse.swt.internal.DefaultSWTFontRegistryTests ‑ fontsAreCached
org.eclipse.swt.internal.DefaultSWTFontRegistryTests ‑ systemFontsAlwaysDependOnPrimaryZoom
org.eclipse.swt.internal.DefaultSWTFontRegistryTests ‑ systemFontsAreCached
org.eclipse.swt.widgets.ControlWin32Tests ‑ testDoNotScaleFontCorrectlyInNoAutoScaleSzenario
org.eclipse.swt.widgets.ControlWin32Tests ‑ testScaleFontCorrectlyInAutoScaleSzenario

♻️ This comment has been updated with latest results.

@arunjose696 arunjose696 force-pushed the arunjose696/389/revertFontRegistry branch from 9e86857 to 08653e1 Compare August 6, 2025 10:57
@arunjose696
Copy link
Contributor Author

Closing this as there is a new PR that fixes the issue #2385

@arunjose696 arunjose696 closed this Aug 7, 2025
@fedejeanne fedejeanne deleted the arunjose696/389/revertFontRegistry branch August 7, 2025 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant