Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG shapes show up all-black when generated with certain Adobe Illustrator settings #96

Open
eirikbakke opened this issue Nov 9, 2024 · 2 comments

Comments

@eirikbakke
Copy link

Greetings! Thank you very much for authoring the excellent JSVG library. In apache/netbeans#7941, we are in the process of switching the NetBeans IDE from Batik to JSVG for icon rendering.

I encountered one problem that was easy to work around; I thought I would document it here in case anyone else encounters it. Feel free to close the issue if it's not worth fixing.

Bug:

SVG files generated by Adobe Illustrator using the "Style Attributes (Entity References)" option show up with correct shapes, but all-black, when rendered with JSVG.

image

Now as it turns out, in recent versions of Adobe Illustrator, the Entity References option is now explicitly labeled as deprecated. So it may not really be necessary to support these kinds of SVGs. The problem could occur when trying to load older SVG files, though.

illustrator_styleattentityrefs

Workaround:

The easy workaround is to simply use another setting when generating the SVG file from Illustrator. The two other settings available are "Style Elements" and "Style Attributes", and they both seem to be working fine with JSVG.

I have attached SVGs generated using each of the three options in case it is useful. The three files were all generated with the same recent version of Adobe Illustrator (version 28.7.2). The "findDropdown_styleattentityrefs.svg" file is the one that does not work with JSVG.

findDropdown_styleattentityrefs.svg: findDropdown_styleattentityrefs
findDropdown_styleattributes.svg: findDropdown_styleattributes
findDropdown_styleelements.svg: findDropdown_styleelements

@weisJ
Copy link
Owner

weisJ commented Nov 15, 2024

I don't think that entity references are something I like to support. They won't be part of the newer SVG 2.0 specification. The only "addition" they give is being able to import external definitions, which has been a security risk with other implementations in the past.

Will leave this open for now just to make it more discoverable (until Adobe has removed the option).

@eirikbakke
Copy link
Author

Yeah, makes sense! Agree wrt. loading of external resources too... I always disable anything like that when parsing XML formats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants