meerk40t / svgelements

SVG Parsing for Elements, Paths, and other SVG Objects.
MIT License
133 stars 29 forks source link

svgelements does not process Patterns #77

Open tatarize opened 3 years ago

tatarize commented 3 years ago

https://www.w3.org/TR/SVG/pservers.html#Patterns

A pattern is used to fill or stroke an object using a pre-defined graphic object which can be replicated ("tiled") at fixed intervals in x and y to cover the areas to be painted. Patterns are defined using a ‘pattern’ element and then referenced by properties fill and stroke on a given graphics element to indicate that the given element shall be filled or stroked with the pattern.

In theory for several vector uses which svgelements is used for a patterned fill could certainly be implemented and expected to cause a repeating use of a subpattern. svgelements however doesn't implement any masking or clipping so determininging what is filling an object would still need to be largely left to the implementation. The pattern would certainly be provided as a stub object.

Like issue #76 this would be classed as a breaking change. The stroke and fill are currently expected to be specifically color elements, not gradients or patterns.