sammycage / lunasvg

SVG rendering and manipulation library in C++
MIT License
866 stars 124 forks source link

Add support of stroke-dasharray #15

Closed bcomb closed 3 years ago

bcomb commented 3 years ago

Split the path before sending it to the rasterizer. This code is just an adaptation of code from https://github.com/Samsung/rlottie

bcomb commented 3 years ago

Hi in order to test my functionnality, i suggest you to also compile the test.cpp example. In this test i generate (svg+png) for Line/Curve/BezierCurve/Arc/QuadraticCurve with different dashing configuration.

I also find a bug with "transparent" color that lead to black filled polygon fe6f848

sammycage commented 3 years ago

Interesting :-) but transparent is not part of SVG 1.1 standard colors : https://github.com/sammycage/lunasvg/commit/fe6f848a84ad9cbe17cdd6f7d1594665d265d6a2

bcomb commented 3 years ago

For the 3495285, i write a minimal test that show the problem wrong_rendering.txt

I need to be able to reuse the same instance of Document in order to load the font once, and render multiple svg.