-
-
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
Gradient Part 6 - Pattern fills #2740
Conversation
As a draft because there is an SVG bug I am still tracking down. |
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! |
Ok, it all looks good on my end, just needs some review :D |
Thanks to @EpicEricEE for pointing out a bug that could occur in PNG rendering that was due to using |
@laurmaedje I am thinking of adding a |
Thank you! 🎉 |
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
pattern
function and typeContent
asbody
em
setrelative
that works the same as gradientsSome limitations:
defs
at 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