Support SVG in image()
Any chance that SVG images can be supported in the image() function?
The problem was always that SVG is not directly supported at the Quartz level. Not sure whether that situation has improved with 10.13 or 10.14.
I’ve managed to use Simple SVG Parser some time ago to create a custom pen to convert flat SVGs into glyphs. the same could work for DrawBot if we add support for colors…
in cocoa a WebKit htmlView can render a svg, convert that to a pdf and use that data in an image. This feels like a big detour ;)
ok, goed to know. but in the meantime, the detour works :)

oh cool could you post this on the drawbot forum?
thanks
I’ve started to convert my quick & dirty example into a more useful conversion ~~tool~~ helper, separating parsing from drawing. (still a work in progress)
I’ve tested it with different SVGs, and not all of them work: simple_svg_parser supports only px as units, so an error is raised for SVGs which have % or cm as units.
there also seems to be a problem with shapes which have a stroke but no fill (I guess it needs to be set to None explicitly, because the default fill is black in DB). for example, this is what I get when trying to draw the GhostScript Tiger:

btw thanks @typemytype for the feedback on the current code – I will be making some changes soon!
I'm a little skeptical about building a full SVG parser like that from scratch. Basic SVG is simple, but the full spec is huge and complex, with masking, reuse of objects, transformations, external references, embedded CSS and and and... And those are only the things which immediately spring to mind.
If the detour via an HTML view and PDF can work reliably, I think that's the better route, as then at least the PDF data is built natively.
@justvanrossum I agree. this is meant only as a helper to get things done today. a bird in the hand…
Good discussion, thanks for the explanations and workaround.