cppfw / svgren

:camera: SVG rendering library in C++
MIT License
206 stars 41 forks source link

<style> element not supported #25

Closed JaimeIvanCervantes closed 4 years ago

JaimeIvanCervantes commented 7 years ago

The <style> element is not supported yet. Support for <style> will require implementing CSS selector logic.

igagis commented 7 years ago

first need to add support for it to svgdom

Papirosnik commented 7 years ago

waiting for its support too )

igagis commented 4 years ago

This is related to https://github.com/igagis/svgdom/issues/32

igagis commented 4 years ago

@JaimeIvanCervantes @Papirosnik I'm currently working on implementing <style> element support. If you have any SVG files which use <style> element would be nice if you share those here, I need sample files for testing.

JaimeIvanCervantes commented 4 years ago

hey @igagis this is great! I just realized that you started a project called cssdom. I am working on a CSS parser myself, and was actually thinking about adding a CSStyleable and support for ElementTypes and classes to your library, but it looks like you already got started on your own. If you give me 3 more days, I can open a repo with what I have so far, and you can take a look. Perhaps you don't have to reinvent the wheel after all ;).

As for examples, I think the most difficult part is getting complex selectors and animations right. I could come up with a few examples for you.

igagis commented 4 years ago

Thanks @JaimeIvanCervantes , I have the CSS parser designed already, at some extent, but would be interesting to see your approach to CSS as well.

I did not plan to add animations yet, as there is no animation support in svgren anyway and I want to start from simple things. Regarding the examples, I meant that if you have any real SVG you would expect to work, I did not mean to invent test samples, as this takes efforts.

igagis commented 4 years ago

<style> element support added to svgren version 0.4.69. All dependency libs have to be update to their latest versions as well.

JaimeIvanCervantes commented 4 years ago

@igagis thanks! This is good news, I'll check it out

igagis commented 4 years ago

There probably will be some bugs related to CSS... I only tested on very simple SVGs