Yeah, I also thought about overlying multiple surfaces. But don't exclude my tip: after all, the colors can give you unique identifiers for the map I've described to you, and this makes the mechanism safe
On Sat, Dec 31, 2022 at 1:23 AM Jean Abou Samra <j...@abou-samra.fr> wrote: > Le 31/12/2022 à 01:13, Paolo Prete a écrit : > > I'll examine it, thanks. > > Meanwhile, I don't know if it is the right case, but it comes to my > > mind a hack, which I applied on some similar code: > > > > Before the SVG bytestream is emitted by the write_func, I would set a > > temporary, special and different _color_ for each grob that is > > associated with output-attributes. > > This color is automatically generated and must obviously be different > > from any other color that will be included in the output SVG. > > Then you can create a map with key = specialcolor, value = pair > > (original color, output-attributes) and when you parse the generated > > bytestream, if you find any set of objects with a color included in > > the map, you can group them, set output attributes on the group and > > restore the original color. > > > > I repeat: this is a hack, it's a bit imaginative and I don't know if > > it's really suitable for the present case. But the unique color > > mechanism is much safer than you might think. > > > Wait, I'm starting to wonder if it's possible via a second surface. > > I'll try this, but not guarantees. > >