drawsvg icon indicating copy to clipboard operation
drawsvg copied to clipboard

style tag

Open matthewturk opened this issue 5 years ago • 1 comments

Hi! Building on #24 I added a way to add <STYLE> tags to the drawing. Would this be a good pull request, or is it sufficiently niche+straightforward that it doesn't belong in the core?

matthewturk avatar Oct 08 '20 15:10 matthewturk

I'm OK with adding the style tag with the caveat (included in its doc string) that many SVG viewers (including Drawing.rasterize() which uses CairoSVG) do not support it and there will be variation between viewers.

See https://www.w3.org/TR/SVG11/styling.html,

"In SVG 1.1, support for inline style sheets using the ‘style’ element and ‘style’ was not required. In SVG 2, these are required."

https://svgwg.org/svg2-draft/styling.html

Keep in mind most viewers only support SVG 1.1 and modern browsers have begun supporting parts of SVG 2.

cduck avatar Oct 08 '20 15:10 cduck