cetz
cetz copied to clipboard
Support multiple closed paths in `merge-path`
Currently at most one closed path could be created by function merge-path
, with optional stroke
and fill
. However in SVG, you can create a "single" path with multiple closed subpaths in the <path>
element.
Consider the following SVG files:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
<path
d="M224 0c-17.7 0-32 14.3-32 32V51.2C119 66 64 130.6 64 208v25.4c0 45.4-15.5 89.5-43.8 124.9L5.3 377c-5.8 7.2-6.9 17.1-2.9 25.4S14.8 416 24 416H424c9.2 0 17.6-5.3 21.6-13.6s2.9-18.2-2.9-25.4l-14.9-18.6C399.5 322.9 384 278.8 384 233.4V208c0-77.4-55-142-128-156.8V32c0-17.7-14.3-32-32-32zm0 96c61.9 0 112 50.1 112 112v25.4c0 47.9 13.9 94.6 39.7 134.6H72.3C98.1 328 112 281.3 112 233.4V208c0-61.9 50.1-112 112-112zm64 352H224 160c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7s18.7-28.3 18.7-45.3z"
fill="#e31919"
/>
</svg>
And here is the shape of it:
You can see that there are 3 closed subpaths in it and the filling is done as a whole.
So I don't know how difficult it is to implement this feature, or it's limited by the underlying drawing functionality of Typst.