Open mm-tom opened 8 years ago
You mean adding attributes to the outputted SVG iconsfrom font glyphs ?
If so, an option like option.attributesMap
providing a an objet to map source SVG font glyphs attributes to the corresponding SVG icon element could make the job.
Something like:
svgfont2svgicons({
attributesMap: {
'target-id' : 'id',
'metadata' : 'metadata',
},
});
On the other side, doing SVG manipulations would better sit in a different module imo (separation of concerns etc.).
Edit: s/svgicons2svgfont/svgfont2svgicons/ ;)
Yes, exactly that.
My slight issue is that my svg font doesn't contain the attributes either, but I do have them to hand.
I'll fork and try to add something in myself. Maybe something separate would be cleaner.
In case you write a separate module, feel free to PR the README to claim its existence.
You mention suggestions for options are welcome, so here goes...
It would be really handy to be able to pass in a set of attributes to apply to the svg node.
In my instance, I'd like to be able to set the id and also perhaps store some other information in arbitrary attributes.