Gradient Part 6 - Pattern fills#2740
Merged
laurmaedje merged 35 commits intotypst:mainfrom Nov 24, 2023
Merged
Conversation
Contributor
Author
|
As a draft because there is an SVG bug I am still tracking down. |
Contributor
Author
|
Ok, the SVG bug is solved and I have updated the original comment to reflect that. I just need to add some automated tests now! |
Contributor
Author
|
Ok, it all looks good on my end, just needs some review :D |
Contributor
Author
|
Thanks to @EpicEricEE for pointing out a bug that could occur in PNG rendering that was due to using |
Contributor
Author
|
@laurmaedje I am thinking of adding a |
laurmaedje
reviewed
Nov 24, 2023
Member
|
Thank you! 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracking issue: #2282
Implements basic pattern fills with an purposefully small API based on the PDF as the common denominator (as it has the most basic support). It is implemented for SVG, PNG with 100% compatibility and in PDF where some readers are slightly buggy but I will be opening bug reports shortly (most notably with mupdf).
The api is as follow
patternfunction and typeContentasbodyemsetrelativethat works the same as gradientsSome limitations:
defsat the top (for compatibility with some SVG readers) and would allow to render patterns only onceHere is an example:
Which looks like this:
I would generally consider the implementation a success, perhaps there is a way we could implement a work around for PDFs and I'd be intereted to hear your opinion/ideas. Here is a test PDF file that shows these small issues for those that want to try it:
test.pdf