Skip to content

Revieve linear gradients and opacity PR #493

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

Merged
merged 79 commits into from
Apr 14, 2025

Conversation

OndrejSpanel
Copy link
Contributor

Attempt to revive #22

It works fine in my fork, it "just" needs resolving possible conflicts.

OndrejSpanel and others added 30 commits December 3, 2018 17:58
…bad starting angle.

This has caused significant performance issues in awt Area constructor sometimes.
…with different opacities and z-index values.
…with different opacities and z-index values.
dependabot bot and others added 7 commits August 30, 2022 16:43
Bumps [junit](https://github.com/junit-team/junit4) from 4.10 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.10.md)
- [Commits](junit-team/junit4@r4.10...r4.13.1)

---
updated-dependencies:
- dependency-name: junit:junit
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [itextpdf](https://github.com/itext/itextpdf) from 5.3.0 to 5.5.12.
- [Release notes](https://github.com/itext/itextpdf/releases)
- [Commits](itext/itextpdf@5.3.0...5.5.12)

---
updated-dependencies:
- dependency-name: com.itextpdf:itextpdf
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
# Conflicts:
#	flying-saucer-core/pom.xml
#	flying-saucer-core/src/main/java/org/xhtmlrenderer/css/constants/IdentValue.java
#	flying-saucer-core/src/main/java/org/xhtmlrenderer/css/constants/Idents.java
#	flying-saucer-core/src/main/java/org/xhtmlrenderer/css/constants/ValueConstants.java
#	flying-saucer-core/src/main/java/org/xhtmlrenderer/css/newmatch/CascadedStyle.java
#	flying-saucer-core/src/main/java/org/xhtmlrenderer/css/newmatch/Selector.java
#	flying-saucer-core/src/main/java/org/xhtmlrenderer/css/parser/CSSParser.java
#	flying-saucer-core/src/main/java/org/xhtmlrenderer/css/parser/FSFunction.java
#	flying-saucer-core/src/main/java/org/xhtmlrenderer/css/parser/FSRGBColor.java
#	flying-saucer-core/src/main/java/org/xhtmlrenderer/css/parser/property/Conversions.java
#	flying-saucer-core/src/main/java/org/xhtmlrenderer/css/parser/property/PrimitivePropertyBuilders.java
#	flying-saucer-core/src/main/java/org/xhtmlrenderer/css/sheet/FontFaceRule.java
#	flying-saucer-core/src/main/java/org/xhtmlrenderer/css/style/CalculatedStyle.java
#	flying-saucer-core/src/main/java/org/xhtmlrenderer/extend/OutputDevice.java
#	flying-saucer-core/src/main/java/org/xhtmlrenderer/layout/BoxBuilder.java
#	flying-saucer-core/src/main/java/org/xhtmlrenderer/layout/Layer.java
#	flying-saucer-core/src/main/java/org/xhtmlrenderer/layout/SharedContext.java
#	flying-saucer-core/src/main/java/org/xhtmlrenderer/render/AbstractOutputDevice.java
#	flying-saucer-core/src/main/java/org/xhtmlrenderer/render/BorderPainter.java
#	flying-saucer-core/src/main/java/org/xhtmlrenderer/swing/Java2DOutputDevice.java
#	flying-saucer-core/src/main/java/org/xhtmlrenderer/util/GeneralUtil.java
#	flying-saucer-examples/pom.xml
#	flying-saucer-fop/pom.xml
#	flying-saucer-log4j/pom.xml
#	flying-saucer-pdf-itext5/pom.xml
#	flying-saucer-pdf-itext5/src/main/java/org/xhtmlrenderer/pdf/ITextOutputDevice.java
#	flying-saucer-pdf-osgi/pom.xml
#	flying-saucer-pdf/pom.xml
#	flying-saucer-pdf/src/main/java/org/xhtmlrenderer/pdf/ITextFontResolver.java
#	flying-saucer-pdf/src/main/java/org/xhtmlrenderer/pdf/ITextOutputDevice.java
#	flying-saucer-swt-examples/pom.xml
#	flying-saucer-swt/pom.xml
#	flying-saucer-swt/src/main/java/org/xhtmlrenderer/swt/SWTOutputDevice.java
#	pom.xml
@OndrejSpanel
Copy link
Contributor Author

Demo screenshot:

image

@asolntsev
Copy link
Contributor

@OndrejSpanel Thank you for the contribution.
Implementing CSS3 features is a valuable direction for FS.
What's your plan? Going to resolve those conflicts?

@OndrejSpanel
Copy link
Contributor Author

I think conflict are already resolved, I will recheck if everything works as intended and then ask for review.

@OndrejSpanel OndrejSpanel force-pushed the opengrabeso-fixes branch 2 times, most recently from d8efd19 to 93465d5 Compare April 13, 2025 07:53
@OndrejSpanel
Copy link
Contributor Author

I think it should be ready now. If it makes review or merging easier, I could prepare a squashed version.

@OndrejSpanel OndrejSpanel marked this pull request as ready for review April 13, 2025 07:59
@OndrejSpanel
Copy link
Contributor Author

Note: my effort concentrates on Graphics2D rendering. While opacity seems to be implemented for PDF, I did not test it. The drawLinearGradient function in ITextOutputDevice is just a stub. I do not use the PDF functionality and I am not familiar with necessary APIs. If anyone want to see this, feel free to take over.

@asolntsev
Copy link
Contributor

@OndrejSpanel Well... I personally don't care about Graphics2D, I use FlyingSaucer to generate PDFs.
So I can just trust your PR and merge it. :)

Usually I prefer to rebase PR, but in this case this option is not available because of conflicts:
image

So what do you prefer, should we squash all 70 commits into one, or is it better to create a merge commit?
image

@OndrejSpanel
Copy link
Contributor Author

So what do you prefer, should we squash all 70 commits into one, or is it better to create a merge commit?

For me it doesn't really matter. I have also prepared #496 in case it is easier for you (commit authorship lost, but I doubt anyone would care about that).

@OndrejSpanel
Copy link
Contributor Author

I use FlyingSaucer to generate PDFs.

Regarding PDF support: while gradients are not implemented in the PDF backend, they should not be difficult to add if anyone is interested. And the opacity should already work, only I did not test it for PDFs.

@asolntsev asolntsev added this to the 9.11.7 milestone Apr 14, 2025
@asolntsev asolntsev self-assigned this Apr 14, 2025
@asolntsev asolntsev merged commit 13be69c into flyingsaucerproject:main Apr 14, 2025
4 checks passed
@asolntsev
Copy link
Contributor

@OndrejSpanel Thank you. After looking at the PR, I decided to merge the original PR - let's keep its history. In case of any troubles, it will be easier to investigate and understand why some changes were done.

asolntsev added a commit that referenced this pull request Apr 14, 2025
PRs #493, #492, #497 contain significant changes, let's release a major version.
@OndrejSpanel OndrejSpanel deleted the opengrabeso-fixes branch April 14, 2025 21:33
@ledfordtj
Copy link

ledfordtj commented Apr 30, 2025

@asolntsev did the PDF support for linear gradient get added before this was merged? This package works amazing for my use case, except I need linear gradient support for PDFs as well. I am happy to help out where I can, but I think I will need some direction.

@asolntsev
Copy link
Contributor

No, I think PDF support was not implemented.
You are welcome. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants