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
SVG Rendering? #177
Comments
In the past I've used the SVG rendering engine. It seems to be forked on GitHub these days (https://github.com/vvvv/SVG). But I didn't use it extensively and I guess the non-local image problem exists with the SVG rendering engine. I do not plan to write my own library, but I guess something like AngleSharp.Svg, which builds upon AngleSharp and a component such as the SVG rendering engine (, or something different) could be possible. This component would only use the rendering / SVG knowledge of the () library. AngleSharp would parse the content already and download any (external) images / resources. At the moment I do not have time for that project, but who knows what will happen in the future (or maybe somebody else is interested in pursuing that project). |
Might be I could lend a hand if we can't find any alternatives. Is the part where AngleSharp parses the SVG and downloads external resources already completed, or is this also something that has yet to be done? |
SVG itself is just plain XML - that works with the XML parser. SVG in HTML is covered as per HTML 5.1 specification. If one does use the Right now no resources inside an SVG document are downloaded. Reason is that the SVGOM is not complete and does not know about any specifics (such as external resources). But in general AngleSharp can download resources. |
Hi @FlorianRappl, Sounds great SVG to images like .png, .jpg, and .gif. What is the status? Kind regards, |
No details available yet, but I guess that this won't be part of |
If I understand correctly its a little bit to early to start with a 3rd component? Maybe I can help in another way? Setup the 3rd component and/or unit tests? Kind regards, |
I guess its too early for the 3rd component, but if you want to you can start and maybe it turns out to be an ideal fit right away. |
…oft.SourceLink.GitHub-1.0.0-beta2-19367-01 Bump Microsoft.SourceLink.GitHub from 1.0.0-beta2-19351-01 to 1.0.0-beta2-19367-01
Since this topic is open already for a long time, I would like to ask for the current state of SVG parsing. We want to parse an SVG based component template system and want to map elements from a real browser dom (rendered component) to the elements within the template files and vise versa. I think this library could be a great help to achieve our goal. @FlorianRappl Is something like that possible with AngleSharp when the template system follows the w3c spec of SVG + some compatible custom additions? Are there parts where we could contribute to fulfil the SVG spec?
I think we will also need some possibility to hook into the parser and resolve the custom template parts to standard SVG. Are such hooks or extensions of the parser possible? |
Regarding SVG parsing: It can be fully parsed either as part of an HTML5 document (
Depends on the "custom additions". But for the rest of the question: I'd say yes.
I think there are two areas where the model in AngleSharp could be improved right now:
Both points (1) and (2) would require a few more tests and few more compliance / improvements towards the SVG spec.
Hm for such points (like the question above) an example would be good. In general the parser streams through and is split in multiple units, most importantly a tokenizer and an OM builder. I think the tokenizer would always be fine - for the OM builder presumably a wrapper would be necessary depending - if it really needs to be resolved at the construction level. |
A lot of the SVGOM seems to already exist in SharpVectors. Perhaps some of that implementation can be adapted to AngleSharp instead of being written from scratch to minimize duplicated effort. |
I am looking for a way to convert SVG images to other image formats (i.e. PNG). Many available libraries do not support e.g. non-local images used in an SVG and up to now I couldn't find any that support embedded fonts (neither embedded via data URI nor via URL).
I stumbled upon your project and simply wanted to ask whether you happen to know a good SVG rendering library, or how far you've come with creating your own?
The text was updated successfully, but these errors were encountered: