iconvg icon indicating copy to clipboard operation
iconvg copied to clipboard

Guidance on how to create IconVG file

Open IchordeDionysos opened this issue 3 years ago • 4 comments

Thanks for you efforts. Really looking forward to official Flutter support!

Just out of curiosity how would those files be created? Are all files at this point handcrafted or is there some library already to generate those from SVGs?

IchordeDionysos avatar May 29 '21 08:05 IchordeDionysos

The old Go library has an Encoder, although it's fairly low level and makes more sense if you've already read the IconVG spec.

https://github.com/golang/exp/blob/b47a03e3048a16e5877dea02cf86e143e549fc46/shiny/iconvg/encode_test.go has some examples.

Please also note that the file format may change soon (issue #4).

nigeltao avatar May 30 '21 00:05 nigeltao

I think the underlying question here is how would you go from a deisgner's drawing to IconVG?

Is there/are there canonical tools for doing this? Are certain formats supported or not?

I imagine, for example, it would be interesting to convert SVGs (or some subset of SVGs) to IconVG. It would also be interesting to export IconVG from Adobe Illustrator or Inkscape. However, there are a significant number of things the SVG spec supports that IconVG doesn't, and it grows further when you add features/extensions from Inkscape or Illustrator or whatever other graphic design tools might exist.

@IchordeDionysos - it would probably be interesting to know what icons you want to encode as IconVG and what format(s) they currently exist in.

It might also be interesting to take an existing SVG renderer and adding an IconVG backend to it, although it might get confusing/frustrating for people who find that it doesn't support particular things.

dnfield avatar Jun 02 '21 04:06 dnfield

Is there/are there canonical tools for doing this?

Today? No. Only ad-hoc programs like https://github.com/golang/exp/blob/master/shiny/materialdesign/icons/gen.go to turn the 2016-era Material Design icons from SVG to IconVG. But that only needed to parse a very, very small subset of SVG. (That a very, very small subset is still useful is kind of the point of IconVG, and I'd expect some SVG features like embedding a <foreignObject> video to simply be unrepresentable in any current or future version of IconVG).

In the future, I'd certainly like Illustrator and Inkscape to both have a one-click "Export to IconVG" the same way they currently have "Export to PNG", but somebody's got to create the tools first...

nigeltao avatar Jun 02 '21 12:06 nigeltao

An inkscape extension must first have something written in python. I haven't seen an code here in python, so that makes such a process harder. Though inkscape has many export formats, so there are many examples of how to achieve the extension.

Once one is made there is a process by which it can be accepted into the inkscape package itself, if the project wants this format supported by default. Further advice can be found at https://chat.inkscape.org/channel/inkscape_extensions and examples at https://gitlab.com/inkscape/extensions/-/tree/master

doctormo avatar Mar 19 '22 20:03 doctormo