-
-
Notifications
You must be signed in to change notification settings - Fork 807
New issue
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
More drawing primitives #260
Comments
I'll try and do Bezier curves! |
I also think a cool feature would be patterns in the |
Added in #333! |
Ok, so I know that this is sort of under way/discussion in #333 , but I am considering taking my own stab at a general For the operations API I imagine a couple of possible solutions:
For both of the two last solutions above I imagine it would look something like this:
|
So you want to add the internal API to the language itself? I think this sounds intresting, although i believe the syntax is a bit weird. You're suddenly in another syntax-context. What about somethink like |
Not really (if I understand you correctly), the language already works this way. Consider the following code which works today:
I find it works well thinking of the typst language as a pure immutable functional language that masquerades as a procedural language with some syntactic sugar. |
I agree that your proposal fits quite well with Typst's design. The only thing I don't like too much is adding all these path ops to the global scope. And people will just try to insert them into their document probably and will see a dictionary instead of a path segment. But I don't really have a better idea. |
I have the same concern and can think of two potential solutions:
|
Yes, both should be possible, although the first one makes it a bit difficult to integrate with the automatically generated documentation. And you can't have mutation across the creation of multiple paths by forcing use of a closure. |
I see that path support was merged in #536 now, is there still interest for a slightly more ergonomic canvas-like api? I started working on an implementation last week that I am wondering if I should finish. |
All primitives requested in the original issue are now implemented. There isn't a more ergonomic canvas-like API at the moment, but that's separate. |
I think we need a place to discuss drawing primitives. For example:
Polygons (Add polygon drawing primitive #314)
Bezier curves (Add a bezier primitive #333)
Stroke improvements (Add support for more complex strokes #505)
Gradient and patterned paints (WIP by me)
The text was updated successfully, but these errors were encountered: