Combining/fusing 2 Svgs

Hey Embers,

I’m trying to combine the contents of two ci::svg::DocRef objects, or underlying objects. The end goal is to be able to render a slash through a symbol. E.g. one svg object might be a file and the other would be the slash through, so combining them would then be a file icon with a slash through.

But I’m not sure about how to best go about it.

I realize that I can just render two ci::svg::DocRef objects on top of eachother, but since I’ll often want to create a ‘not x’ icon of many things, I’d prefer to create an entirely new ci::svg::DocRef which combines the two.

If anyone has any suggestions, I’m all ears.

Thanks in advance,

Gazoo

I’ve made some head way.

I’ve found the svg::Group object, and I think that’s a way forward. But I’m not entirely sure how do add things. I’m looking at the mChildren property but it only accepts nodes and I’m not sure how to get the node out of an svg::Doc as of yet.

I’ve spent some more time, but still without any working leads, so at this stage I’m going to manually combine the Svg’s in editing tools.

If anyone has any ideas I’m keen to hear them as I’ve not been able to find a solution so far.

Cheers,
Gazoo

I’m not sure you can do this in Cinder. Would calling a 3rd party script or command line application work for you?

@gabor_papp I have considered that option. But that’d likely be too cumbersome to implement in a ‘clean’ way, so I’ve opted to just manually combine the Svgs for now, and in the case where I really need the dynamic behavior, I’ll have to live with rendering two different Svgs I think.

Really appreciate the response though @gabor_papp