Provide option to ignore errors
I'm using Omnigraffle to create SVG assets and it provides extra elements (example: "metadata" is used to include version information) and it also includes "font-face" (I'm using a font loaded from assets, so it's not an issue). But, these cause flutter_svg to output errors as these are not supported elements. My stuff renders fine, I just want to have the ability to remove these parsing errors as they are not helpful.
Is there some reason that you can't just remove the unused tags from your file? It would both reduce the parse time and the bundle size of your application.
Hi Dan - Thanks for checking in. No, technically, there's no reason and that is my current workaround. The issue is that I do all of my app icons this way (I have about 50 of them so far), and it was a bit tedious to manually go remove all the unused/unsupported tags by hand. My next move is to write a dart based command line tool to automate the process. If you tell this is not something worth dealing with, I'll do that. I guess I was always of a mind that unsupported tags are just ignored rather than generate error messages, but maybe there's a good reason for it and I'm not aware.
I've found svgcleaner to be pretty good at cleaning a lot of that stuff up and compressing the SVG down a bit further. If you have a build rule set up for that it'd be cool to add here or in another package.
Thanks for the pointer, I will give it a try. In my read through the docs though, it looks like it won't remove font-face which is one of the problem elements. Thanks again!
Ahhh yes you are right.
....the other option is of course to just support font-face :)
Well, get on that :)....