We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
svg-path
With the introduction of curve in Typst 0.13, it's now possible to construct a path primitive with fully functional.
curve
It would be nice to have a draw function that corresponds to the SVG path.
For example, consider the following SVG path:
<path d="M 10 80 C 40 10, 65 10, 95 80 S 150 150, 180 80 Z" stroke="black" fill="transparent"/>
It could be implemented using svg-path as below:
svg-path( stroke: black, fill: none, ("M", (10, 80)), ("C", (40, 10), (65, 10), (95, 80)), ("S", (150, 150), (180, 80)), ("Z"), )
The command in SVG path:
where uppercase letters indicate absolute positioning, and lowercase letters indicate relative positioning.
Except the command A/a (elliptical arc), other command can be mapped directly to a curve element.
A/a
The advantage is that it is easy to construct complex path objects (manually or programmatically) concisely.
In addition, it is convenient to realize the automatic conversion of SVG path to CeTZ code (Maybe there will be a tool like SVG2CeTZ?).
SVG2CeTZ
The text was updated successfully, but these errors were encountered:
The internal path representation of cetz has to be changed first, but this is a nice feature to have.
Sorry, something went wrong.
johannes-wolf
No branches or pull requests
With the introduction of
curve
in Typst 0.13, it's now possible to construct a path primitive with fully functional.It would be nice to have a draw function that corresponds to the SVG path.
For example, consider the following SVG path:
It could be implemented using
svg-path
as below:The command in SVG path:
where uppercase letters indicate absolute positioning, and lowercase letters indicate relative positioning.
Except the command
A/a
(elliptical arc), other command can be mapped directly to acurve
element.The advantage is that it is easy to construct complex path objects (manually or programmatically) concisely.
In addition, it is convenient to realize the automatic conversion of SVG path to CeTZ code (Maybe there will be a tool like
SVG2CeTZ
?).The text was updated successfully, but these errors were encountered: