Version 0.3.1
Highlights
Level 4 colors and Level 5 color-mix()
This library already admitted Level 4 colors and Level 5 color-mix()
if one used the CSSTranscodingHelper, but now those color values are natively processed. However, for now only the sRGB color gamut is supported; if a color happens to be out of that gamut, it is clamped.
More tolerance to errors
Whenever a user agent encounters errors in an SVG document, according to the specification, it is supposed to continue processing the document until the end:
The document rendering shall continue after encountering element which has an error. The element or its part that is in error won't be rendered.
Apache Batik stops processing whenever it finds an error, including perfectly valid (but unsupported) CSS, a behavior which is non-conformant. EchoSVG was already doing better because it ignored unsupported rules as well as CSS errors, but in previous versions the errors in CSS values continued to be a problem (although it was possible to bypass it using the CSS Helper). Now this library finally ignores CSS value errors, as well as missing element references.
Thanks to the changes shipped in this release, EchoSVG can now render this file, that was deliberately filled with reference errors, with more reliability than the big web browsers. The next image is the render by EchoSVG:
Apache Batik fails to render, while Inkscape produced this:
Firefox does much better, but still not as good as EchoSVG:
Google Chrome produces essentially the same image as Firefox.
If you are hit by a case where EchoSVG's error handling is non-conformant, please open an issue.
Support the namespaceless href
attribute of SVG2
This helps a lot when processing modern SVG documents, see https://svgwg.org/svg2-draft/linking.html#XLinkRefAttrs
Currently, xlink:href
is checked first, and if nothing is found then href
is used. This behaviour could be reversed (to check href
first) if in the future it is considered more conformant.
Bug fixes and performance improvements
A few important bugs have been fixed, please read the list of changes for details.
Detail of changes
- awt: statically evaluate
isColorConvertOpAplhaSupported
. [BATIK-1354] - bridge: be tolerant to missing references. #80
- css: do not stop CSS processing when an unknown or wrong value is found. #78
- css: support Level 4 CSS Color (and Level 5
color-mix()
) values in sRGB gamut. #77 - css: fix NPE in
CSSEngine
when the document has nodocumentURI
. - dom: support the namespaceless
href
attribute of SVG2. - dom: support surrogate characters.
- gvt: fix race conditions in
AWTGlyphGeometryCache
(includes BATIK-1271). - gvt: fix SVG to PNG Rendering due to missing Arabic characters from the map. Based on patch by Paritosh Chauhan [BATIK-1355]
- transcoder: add methods to transcode from a
TranscoderInput
and aDocument
instance using the Helper. - transcoder: do not overwrite the error handler in the
CSSTranscodingHelper
. - Tests: make less verbose the rendering tests that expect errors.
- README: a more informative introduction.
- README: add a section about OWASP Dependency Check.
- SECURITY: how to report a vulnerability.
- Add a section about security scanners to
SECURITY.md
. - Improve code style section in
CONTRIBUTING.md
. - Gradle: add OWASP's
org.owasp.dependencycheck
plugin. - Bump
org.junit.jupiter:junit-jupiter
from 5.9.2 to 5.9.3 - Upgrade Gradle wrapper to 8.1.1
- Upgrade to GrGit 5.2.0
- Upgrade to extra-java-module-info 1.4.1