Investigate font size inconsistency across SWT platforms (macOS vs Windows/Linux)#25
Draft
Investigate font size inconsistency across SWT platforms (macOS vs Windows/Linux)#25
Conversation
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Investigate inconsistent font sizes across SWT platforms
Investigate font size inconsistency across SWT platforms (macOS vs Windows/Linux)
Jan 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fonts with identical point sizes render 25% smaller on macOS compared to Windows/Linux. This investigation analyzes the root cause and proposes concrete solutions.
Investigation Summary
Root Cause: SWT implicitly assumes 96 DPI as the logical baseline across all platforms, but macOS natively uses 72 DPI (PostScript convention: 1pt = 1/72"). The conversion formula
size = height * dpi / screenDPIis mathematically correct but produces visually inconsistent results:Deliverables
Technical Analysis (
docs/font-size-inconsistency-investigation.md)Font.init()andDevice.getScreenDPI()Solution Proposals (
docs/font-size-inconsistency-mitigations.md)Solution 1 (Quick fix): Normalize macOS DPI
Solution 2 (Proper fix): Font-level normalization
getScreenDPI()for printingSolution 3 (Long-term): Configuration API
getDPI()Solution 4: Replacement APIs for deprecated
getDPI()with clear semanticsValidation Tool (
Snippet_FontConsistencyTest.java)Visual test snippet with:
Executive Summary (
docs/font-size-inconsistency-summary.md)High-level overview with roadmap, FAQ, migration guide
Recommended Path
Current Workaround (Can Be Removed After Fix)
This investigation provides the technical foundation for addressing issue eclipse-platform#2925 with minimal breaking changes and clear migration paths.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.