-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Styles in the style tag instead of as attributes on the tags? #24
Comments
Hi! Sorry for the delay. Unfortuately, VectSharp.SVG currently does not support this; I can think about it, but I have no idea when/if I will be able to implement it. In the meantime, if you know (or have a way of knowing) the attributes that are the same for all objects, maybe you could "post-process" the SVG code, e.g. by replacing |
AFAIK XML can be compressed: https://github.com/managed-commons/SvgNet/blob/70658aa68592125d95b4cd602df23efe1fd827d9/SvgNet/SvgFactory.cs - see method CompressXML (line 99). |
From what I understand, that code uses XML entities to compress the attributes; this is not really necessary for an SVG document, because you can just use CSS classes. I just released VectSharp.SVG version 1.7.0, which adds an optional Hopefully this will be helpful with your use case! |
I'm closing this for now, feel free to reopen or to create another issue if you have any problems! |
Hey Giorgio, nice work on the library!
I'm experimenting with using your library to handle widget rendering in my Map Projection software and one feature I'd like is the ability to have all the style information output as css in the
style
tag, rather than as attributes on the various paths.My use case involves passing the svg file to the user for further editing, and all the styles for every line will be identical, so for file size and ease of editing, I'd like to consolidate the style information.
Does VectSharp already support such a thing, or is it something you're interested in adding?
The text was updated successfully, but these errors were encountered: