Opened 8 days ago
Last modified 24 hours ago
#24793 reopened enhancement
Boundaries of SVG support - Consider switching from svgsalamander to JSVG
| Reported by: | Kilkenni | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | 26.07 |
| Component: | Core | Version: | |
| Keywords: | Cc: |
Description (last modified by )
While working on some icons, I've found that certain SVG features do not display properly in JOSM. Specifically, the paint-order directive described in MDN https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/paint-order is ignored.
Afaik, it is a part of the SVG2 standard, but it's quite established at this point and has been supported by modern browsers for 5+ years. Is this a problem with the SVG engine in JOSM?
If it is, it would be useful to mention this in JOSM wiki (for example, here https://josm.openstreetmap.de/wiki/Styles#Icons), pointing out that SVG2 icons are not supported.
Attachments (2)
Change History (9)
by , 8 days ago
| Attachment: | 2026-07-07_14-52-09.png added |
|---|
comment:1 by , 8 days ago
| Description: | modified (diff) |
|---|
follow-up: 3 comment:2 by , 8 days ago
| Resolution: | → othersoftware |
|---|---|
| Status: | new → closed |
JOSM uses SVG-Salamander for SVG support as long as Java does not support SVG directly. See https://github.com/blackears/svgSalamander for the upstream project.
comment:3 by , 7 days ago
Replying to stoecker:
JOSM uses SVG-Salamander for SVG support as long as Java does not support SVG directly. See https://github.com/blackears/svgSalamander for the upstream project.
So I take it, the answer is 'yes'. Salamander repo suggests that it has been in maintenance mode for years, and new features (like SVG 2 support) are unlikely.
comment:4 by , 7 days ago
| Resolution: | othersoftware |
|---|---|
| Status: | closed → reopened |
| Summary: | Boundaries of SVG support → Boundaries of SVG support - Consider switching from svgsalamander to JSVG |
Probably a switch to https://github.com/weisJ/jsvg would be an option. A few places in ImageProvider and one function in ImageResource would need to be adapted. Seems pretty straightforward.
Patches welcome.
follow-up: 6 comment:5 by , 7 days ago
| Milestone: | → 26.07 |
|---|
Hmm, can anyone test? Seems to work as far as I can see.
A bunch of new warnings for some SVGs (LoaderContext needs to be extended with file name information for log).
comment:6 by , 4 days ago
Replying to stoecker:
Hmm, can anyone test? Seems to work as far as I can see.
A bunch of new warnings for some SVGs (LoaderContext needs to be extended with file name information for log).
Woah. That was fast.
Kudos to you!
(I don't know how to test a patch yet, can you point me in the right direction?)
comment:7 by , 24 hours ago
Try https://tmp.gnssonline.eu/josm-custom.jar (temporary, will be deleted soon) for a version including that change.



Example of an icon using paint-order directive in its SVG. Other icons nearby do not use paint-order.