Skip to content

Conversation

@Michael5601
Copy link
Contributor

@Michael5601 Michael5601 commented Dec 11, 2024

Please see this Draft for a detailed description.

The new functionality of this draft can be found in the commit 05e7d58. The other commit is the functionality from the PR that this draft is based on.

Fixes eclipse-platform/eclipse.platform.swt#1438.

@github-actions
Copy link
Contributor

Test Results

 1 824 files  ±0   1 824 suites  ±0   1h 35m 43s ⏱️ - 3m 8s
 7 918 tests ±0   7 690 ✅ +1  228 💤 ±0  0 ❌  - 1 
23 841 runs  ±0  23 093 ✅ +1  748 💤 ±0  0 ❌  - 1 

Results for commit 59a47de. ± Comparison against base commit 586ef10.

Feature Proposal: Rasterization of SVGs at Runtime for Eclipse Icons
Fixes #1438

Eclipse currently loads icons exclusively as raster graphics (e.g., `.png`), without support for vector formats like `.svg`. A major drawback of raster graphics is their inability to scale without degrading image quality. Additionally, generating icons of different sizes requires manually rasterizing SVGs outside Eclipse, leading to unnecessary effort and many icon files.

This PR introduces support for vector graphics in Eclipse, enabling SVGs to be used for icons. Existing PNG icons will continue to be loaded alongside SVGs, allowing the use of the new functionality without the need to replace all PNG files at once.

---
- **How It Works**:
  - To use SVG icons, simply place the SVG file in the bundle and reference it in the `plugin.xml` and other necessary locations, as is done for PNGs. No additional configuration is required.
  - At runtime, Eclipse uses the library JSVG to rasterize the SVG into a raster image of the desired size, eliminating the need for scaling. My analysis shows that JSVG is the most suitable Java library for this purpose.
  - You need to write the flag `-Dswt.autoScale=quarter` into your `eclipse.ini` file or into the run arguments of a new configuration.
@Michael5601 Michael5601 deleted the IconScalingWithDisabledLogic branch June 16, 2025 07:38
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

Successfully merging this pull request may close these issues.

Improving Eclipse Icon Scaling by Supporting Vectorized Icons

3 participants