SVG weird code
When exporting an icon to SVG with XD it creates some weird code. I'm not a developer so hopefully this is understandable. Our developer is using Android Studio to put the SVG icons to use but it generates an error.
When I export the same icon with illustrator it works perfectly. It even generates some real clean code in Android Studio according to our developer. I also noticed a difference when opening both the attachments in notepad to view the code.
The export options I used in AI:
SVG Profiles: 1.1
Type: Adobe CEF
Image Location: Link
Can you share a video of what you’re seeing and post the link here for the file? You can post via WeTransfer.com The team uses Licecap to create gifs which works really well https://www.cockos.com/licecap/
Mark Segalis commented
When exporting as SVG a Group or a Symbol the canvas size of the SVG is same as the canvas of the entire workspace of XD.
Qt imports the SVG with the entire canvas (meaning the component is virtually invisible).
Workaround - open in Illustrator the exported SVGs and save them again. Illustrator corrects the SVGs.
It's just strange why not use the same SVG export for all Adobe product... and develop a buggy one in XD when there's a properly working one in Illustrator
Boy Lenssen commented
Hi, I'm the developer. AS still gives issues. The problem is mainly that Illustrator uses the `evenodd` fill rule, which is not supported by Android, it uses `nonzero`.
Currently I'm using sites as http://a-student.github.io/SvgToVectorDrawableConverter.Web/ to convert them to Android SVG's (result is an XML file used in Android. When you import SVG in AS, they will be converted to XML too)
Christian Aphects Franco commented
Also experiencing this bug as well, the problem is that every shape seems to get transform/translate property thats relative to the viewbox xd generates for the export.