Draw with SVG commands #558
liuguangxi
started this conversation in
Ideas
Replies: 1 comment
-
I played around with the idea when svg decoding first came out and left my thoughts in #122. Essentially the cons outway the pros |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As in the previous discussion #553, the drawing function in Typst is more or less limited. I have an idea that we can generate SVG codes in Typst and show it with
image.decode
.Here is an example:
And the output is:
Note that there are some drawing features in SVG that are not yet supported in Typst, such as multiple closed subpaths in the path object, clip path, filter and so on. As SVG code is just a string, drawing properties are easy to generate and modify dynamically. The decoded SVG objects can be easily integrated with CeTZ.
I'm wondering if some drawing functionalities or even drawing packages can be implemented indirectly by generating SVG codes, although this may seem a little unusual.
Beta Was this translation helpful? Give feedback.
All reactions