Modify

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 Kilkenni)

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)

2026-07-07_14-52-09.png (7.0 KB ) - added by Kilkenni 8 days ago.
Example of an icon using paint-order directive in its SVG. Other icons nearby do not use paint-order.
24793.patch (13.5 KB ) - added by stoecker 7 days ago.
Switch to jsvg

Download all attachments as: .zip

Change History (9)

by Kilkenni, 8 days ago

Attachment: 2026-07-07_14-52-09.png added

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

comment:1 by Kilkenni, 8 days ago

Description: modified (diff)

comment:2 by stoecker, 8 days ago

Resolution: othersoftware
Status: newclosed

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.

in reply to:  2 comment:3 by Kilkenni, 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 stoecker, 7 days ago

Resolution: othersoftware
Status: closedreopened
Summary: Boundaries of SVG supportBoundaries 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.

comment:5 by stoecker, 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).

by stoecker, 7 days ago

Attachment: 24793.patch added

Switch to jsvg

in reply to:  5 comment:6 by Kilkenni, 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?)

Last edited 4 days ago by Kilkenni (previous) (diff)

comment:7 by stoecker, 24 hours ago

Try https://tmp.gnssonline.eu/josm-custom.jar (temporary, will be deleted soon) for a version including that change.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as reopened The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user. Next status will be 'new'.
Next status will be 'needinfo'. The owner will be changed from team to Kilkenni.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.