[Git][java-team/jfreesvg][upstream] New upstream version 5.0.2

Ole Streicher (@olebole) gitlab at salsa.debian.org
Tue Dec 21 13:24:54 GMT 2021



Ole Streicher pushed to branch upstream at Debian Java Maintainers / jfreesvg


Commits:
f3764346 by Ole Streicher at 2021-12-21T14:04:24+01:00
New upstream version 5.0.2
- - - - -


24 changed files:

- README.md
- jfreesvg.svg
- pom.xml
- src/main/java/org/jfree/svg/ImageElement.java
- src/main/java/org/jfree/svg/MeetOrSlice.java
- src/main/java/org/jfree/svg/PreserveAspectRatio.java
- src/main/java/org/jfree/svg/SVGGraphics2D.java
- src/main/java/org/jfree/svg/SVGGraphicsConfiguration.java
- src/main/java/org/jfree/svg/SVGGraphicsDevice.java
- src/main/java/org/jfree/svg/SVGHints.java
- src/main/java/org/jfree/svg/SVGUnits.java
- src/main/java/org/jfree/svg/SVGUtils.java
- src/main/java/org/jfree/svg/StandardFontFunction.java
- src/main/java/org/jfree/svg/ViewBox.java
- src/main/java/org/jfree/svg/util/Args.java
- src/main/java/org/jfree/svg/util/DoubleConverter.java
- src/main/java/org/jfree/svg/util/GradientPaintKey.java
- src/main/java/org/jfree/svg/util/GraphicsUtils.java
- src/main/java/org/jfree/svg/util/LinearGradientPaintKey.java
- src/main/java/org/jfree/svg/util/RadialGradientPaintKey.java
- src/test/java/org/jfree/svg/TestDoubleConversion.java
- src/test/java/org/jfree/svg/TestGeneral.java
- src/test/java/org/jfree/svg/TestSVGGraphics2D.java
- src/test/java/org/jfree/svg/util/ArgsTest.java


Changes:

=====================================
README.md
=====================================
@@ -1,9 +1,9 @@
 JFreeSVG
 ========
 
-Version 5.0.1, by David Gilbert, 4 August 2021.
+Version 5.0.2, by David Gilbert, 7 November 2021.
 
-(C)opyright 2013-2021, by Object Refinery Limited.  All rights reserved.
+(C)opyright 2013-2021, by David Gilbert.  All rights reserved.
 
 [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.jfree/org.jfree.svg/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.jfree/org.jfree.svg)
 
@@ -31,7 +31,7 @@ JFreeSVG is published to the Central Repository.  You can include it in your pro
     <dependency>
         <groupId>org.jfree</groupId>
         <artifactId>org.jfree.svg</artifactId>
-        <version>5.0.1</version>
+        <version>5.0.2</version>
     </dependency>
 
 JFreeSVG is a modular library with the module name `org.jfree.svg`.
@@ -41,7 +41,7 @@ To use JFreeSVG with Java 8, you can use the following (note the different artif
     <dependency>
         <groupId>org.jfree</groupId>
         <artifactId>jfreesvg</artifactId>
-        <version>3.4.1</version>
+        <version>3.4.2</version>
     </dependency>
 
 Build
@@ -65,7 +65,7 @@ Testing
 
 License
 -------
-JFreeSVG is free software under the terms of the GNU General Public License version 3 (GPLv3) or later.  The license file is included in this distribution (gpl-3.0.txt).  If you prefer not to be bound by the terms of the GPLv3, you can purchase an alternative license from Object Refinery Limited (please e-mail info at object-refinery.com for details, or check the JFreeSVG home page).
+JFreeSVG is free software under the terms of the GNU General Public License version 3 (GPLv3) or later.  The license file is included in this distribution (gpl-3.0.txt).  If you prefer not to be bound by the terms of the GPLv3, you can purchase an alternative license (please e-mail dave at jfree.org for details, or check the JFreeSVG home page).
 
     Please note that JFreeSVG is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
@@ -75,6 +75,10 @@ JFreeSVG is free software under the terms of the GNU General Public License vers
 Change History
 --------------
 
+Version 5.0.2 (7 November 2021)
+- add support for `TextAttribute.TRACKING`;
+- clarified Javadocs for `SVGHints.KEY_BEGIN_GROUP`.
+
 Version 5.0.1 (4 August 2021)
 - handle cycle methods for `GradientPaint` and `RadialGradientPaint`;
 - fix output for filled `Ellipse2D`.


=====================================
jfreesvg.svg
=====================================
The diff for this file was not included because it is too large.

=====================================
pom.xml
=====================================
@@ -5,7 +5,7 @@
  
     <groupId>org.jfree</groupId>
     <artifactId>org.jfree.svg</artifactId>
-    <version>5.0.1</version>
+    <version>5.0.2</version>
     <packaging>jar</packaging>
 
     <name>JFreeSVG</name>
@@ -42,7 +42,7 @@
         <dependency>
             <groupId>org.junit.jupiter</groupId>
             <artifactId>junit-jupiter-api</artifactId>
-            <version>5.7.0</version>
+            <version>5.7.2</version>
             <scope>test</scope>
         </dependency>
         <dependency>


=====================================
src/main/java/org/jfree/svg/ImageElement.java
=====================================
@@ -2,7 +2,7 @@
  * JFreeSVG : an SVG library for the Java(tm) platform
  * ===================================================
  * 
- * (C)opyright 2013-2021, by Object Refinery Limited.  All rights reserved.
+ * (C)opyright 2013-2021, by David Gilbert.  All rights reserved.
  *
  * Project Info:  http://www.jfree.org/jfreesvg/index.html
  * 


=====================================
src/main/java/org/jfree/svg/MeetOrSlice.java
=====================================
@@ -2,7 +2,7 @@
  * JFreeSVG : an SVG library for the Java(tm) platform
  * ===================================================
  * 
- * (C)opyright 2013-2021, by Object Refinery Limited.  All rights reserved.
+ * (C)opyright 2013-2021, by David Gilbert.  All rights reserved.
  *
  * Project Info:  http://www.jfree.org/jfreesvg/index.html
  * 


=====================================
src/main/java/org/jfree/svg/PreserveAspectRatio.java
=====================================
@@ -2,7 +2,7 @@
  * JFreeSVG : an SVG library for the Java(tm) platform
  * ===================================================
  * 
- * (C)opyright 2013-2021, by Object Refinery Limited.  All rights reserved.
+ * (C)opyright 2013-2021, by David Gilbert.  All rights reserved.
  *
  * Project Info:  http://www.jfree.org/jfreesvg/index.html
  * 


=====================================
src/main/java/org/jfree/svg/SVGGraphics2D.java
=====================================
@@ -2,7 +2,7 @@
  * JFreeSVG : an SVG library for the Java(tm) platform
  * ===================================================
  * 
- * (C)opyright 2013-2021, by Object Refinery Limited.  All rights reserved.
+ * (C)opyright 2013-2021, by David Gilbert.  All rights reserved.
  *
  * Project Info:  http://www.jfree.org/jfreesvg/index.html
  * 
@@ -52,6 +52,7 @@ import java.awt.Shape;
 import java.awt.Stroke;
 import java.awt.font.FontRenderContext;
 import java.awt.font.GlyphVector;
+import java.awt.font.TextAttribute;
 import java.awt.font.TextLayout;
 import java.awt.geom.AffineTransform;
 import java.awt.geom.Arc2D;
@@ -1550,6 +1551,14 @@ public final class SVGGraphics2D extends Graphics2D {
         if (this.font.isItalic()) {
             b.append(" font-style: italic;");
         }
+        Object tracking = this.font.getAttributes().get(TextAttribute.TRACKING);
+        if (tracking instanceof Number) {
+            double spacing = ((Number) tracking).doubleValue() * this.font.getSize();
+            if (Math.abs(spacing) > 0.000001) { // not zero
+                b.append(" letter-spacing: ").append(geomDP(spacing)).append(';');
+            }
+        }
+
         return b.toString();
     }
 


=====================================
src/main/java/org/jfree/svg/SVGGraphicsConfiguration.java
=====================================
@@ -2,7 +2,7 @@
  * JFreeSVG : an SVG library for the Java(tm) platform
  * ===================================================
  * 
- * (C)opyright 2013-2021, by Object Refinery Limited.  All rights reserved.
+ * (C)opyright 2013-2021, by David Gilbert.  All rights reserved.
  *
  * Project Info:  http://www.jfree.org/jfreesvg/index.html
  * 


=====================================
src/main/java/org/jfree/svg/SVGGraphicsDevice.java
=====================================
@@ -2,7 +2,7 @@
  * JFreeSVG : an SVG library for the Java(tm) platform
  * ===================================================
  * 
- * (C)opyright 2013-2021, by Object Refinery Limited.  All rights reserved.
+ * (C)opyright 2013-2021, by David Gilbert.  All rights reserved.
  *
  * Project Info:  http://www.jfree.org/jfreesvg/index.html
  * 


=====================================
src/main/java/org/jfree/svg/SVGHints.java
=====================================
@@ -2,7 +2,7 @@
  * JFreeSVG : an SVG library for the Java(tm) platform
  * ===================================================
  * 
- * (C)opyright 2013-2021, by Object Refinery Limited.  All rights reserved.
+ * (C)opyright 2013-2021, by David Gilbert.  All rights reserved.
  *
  * Project Info:  http://www.jfree.org/jfreesvg/index.html
  * 
@@ -49,9 +49,10 @@ import java.util.List;
  * <li>{@link #KEY_ELEMENT_ID} that allows the caller to specify the element
  * ID for the next element;</li>
  * <li>{@link #KEY_BEGIN_GROUP} tells the {@code SVGGraphics2D} instance 
- * to start a new group element with an id equal to the hint value (which must 
- * be an instance of String).  Any other {@code Graphics2D} implementation 
- * will ignore this hint;</li>
+ * to start a new group element with attributes controlled by the hint value
+ * (which may be a {@code String} for the group ID or, more generally, a
+ * {@code Map} containing arbitrary attribute values).  Any other
+ * {@code Graphics2D} implementation will ignore this hint;</li>
  * <li>{@link #KEY_END_GROUP} tells the {@code SVGGraphics2D} instance 
  * to end a group element.  The hint value is ignored.  The caller assumes 
  * responsibility for balancing the number of {@code KEY_BEGIN_GROUP} and 
@@ -151,9 +152,16 @@ public final class SVGHints {
 
     /**
      * Hint key that informs the {@code SVGGraphics2D} that the caller 
-     * would like to begin a new group element.  The hint value is the id for 
-     * the new group.  After opening the new group the hint is cleared and it 
-     * is the caller's responsibility to close the group later using 
+     * would like to begin a new group element.  The hint value is either:
+     *
+     * <ul>
+     *     <li>a {@code String} that will be used as the value of the
+     *     {@code id} attribute for the group; or</li>
+     *     <li>a {@code Map} instance containing arbitrary attribute values for the
+     *     group (usually including an {@code id}).</li>
+     * </ul>
+     * After opening the new group the hint is cleared and it is the caller's
+     * responsibility to close the group later using
      * {@link SVGHints#KEY_END_GROUP}.  Groups can be nested.
      * 
      * @since 1.7


=====================================
src/main/java/org/jfree/svg/SVGUnits.java
=====================================
@@ -2,7 +2,7 @@
  * JFreeSVG : an SVG library for the Java(tm) platform
  * ===================================================
  * 
- * (C)opyright 2013-2021, by Object Refinery Limited.  All rights reserved.
+ * (C)opyright 2013-2021, by David Gilbert.  All rights reserved.
  *
  * Project Info:  http://www.jfree.org/jfreesvg/index.html
  * 


=====================================
src/main/java/org/jfree/svg/SVGUtils.java
=====================================
@@ -2,7 +2,7 @@
  * JFreeSVG : an SVG library for the Java(tm) platform
  * ===================================================
  * 
- * (C)opyright 2013-2021, by Object Refinery Limited.  All rights reserved.
+ * (C)opyright 2013-2021, by David Gilbert.  All rights reserved.
  *
  * Project Info:  http://www.jfree.org/jfreesvg/index.html
  * 


=====================================
src/main/java/org/jfree/svg/StandardFontFunction.java
=====================================
@@ -2,7 +2,7 @@
  * JFreeSVG : an SVG library for the Java(tm) platform
  * ===================================================
  * 
- * (C)opyright 2013-2021, by Object Refinery Limited.  All rights reserved.
+ * (C)opyright 2013-2021, by David Gilbert.  All rights reserved.
  *
  * Project Info:  http://www.jfree.org/jfreesvg/index.html
  * 


=====================================
src/main/java/org/jfree/svg/ViewBox.java
=====================================
@@ -2,7 +2,7 @@
  * JFreeSVG : an SVG library for the Java(tm) platform
  * ===================================================
  * 
- * (C)opyright 2013-2021, by Object Refinery Limited.  All rights reserved.
+ * (C)opyright 2013-2021, by David Gilbert.  All rights reserved.
  *
  * Project Info:  http://www.jfree.org/jfreesvg/index.html
  * 


=====================================
src/main/java/org/jfree/svg/util/Args.java
=====================================
@@ -2,7 +2,7 @@
  * JFreeSVG : an SVG library for the Java(tm) platform
  * ===================================================
  * 
- * (C)opyright 2013-2021, by Object Refinery Limited.  All rights reserved.
+ * (C)opyright 2013-2021, by David Gilbert.  All rights reserved.
  *
  * Project Info:  http://www.jfree.org/jfreesvg/index.html
  * 


=====================================
src/main/java/org/jfree/svg/util/DoubleConverter.java
=====================================
@@ -2,7 +2,7 @@
  * JFreeSVG : an SVG library for the Java(tm) platform
  * ===================================================
  * 
- * (C)opyright 2013-2021, by Object Refinery Limited.  All rights reserved.
+ * (C)opyright 2013-2021, by David Gilbert.  All rights reserved.
  *
  * Project Info:  http://www.jfree.org/jfreesvg/index.html
  * 


=====================================
src/main/java/org/jfree/svg/util/GradientPaintKey.java
=====================================
@@ -2,7 +2,7 @@
  * JFreeSVG : an SVG library for the Java(tm) platform
  * ===================================================
  * 
- * (C)opyright 2013-2021, by Object Refinery Limited.  All rights reserved.
+ * (C)opyright 2013-2021, by David Gilbert.  All rights reserved.
  *
  * Project Info:  http://www.jfree.org/jfreesvg/index.html
  * 


=====================================
src/main/java/org/jfree/svg/util/GraphicsUtils.java
=====================================
@@ -2,7 +2,7 @@
  * JFreeSVG : an SVG library for the Java(tm) platform
  * ===================================================
  * 
- * (C)opyright 2013-2020, by Object Refinery Limited.  All rights reserved.
+ * (C)opyright 2013-2021, by David Gilbert.  All rights reserved.
  *
  * Project Info:  http://www.jfree.org/jfreesvg/index.html
  * 


=====================================
src/main/java/org/jfree/svg/util/LinearGradientPaintKey.java
=====================================
@@ -2,7 +2,7 @@
  * JFreeSVG : an SVG library for the Java(tm) platform
  * ===================================================
  * 
- * (C)opyright 2013-2021, by Object Refinery Limited.  All rights reserved.
+ * (C)opyright 2013-2021, by David Gilbert.  All rights reserved.
  *
  * Project Info:  http://www.jfree.org/jfreesvg/index.html
  * 


=====================================
src/main/java/org/jfree/svg/util/RadialGradientPaintKey.java
=====================================
@@ -2,7 +2,7 @@
  * JFreeSVG : an SVG library for the Java(tm) platform
  * ===================================================
  * 
- * (C)opyright 2013-2021, by Object Refinery Limited.  All rights reserved.
+ * (C)opyright 2013-2021, by David Gilbert.  All rights reserved.
  *
  * Project Info:  http://www.jfree.org/jfreesvg/index.html
  * 


=====================================
src/test/java/org/jfree/svg/TestDoubleConversion.java
=====================================
@@ -2,7 +2,7 @@
  * JFreeSVG : an SVG library for the Java(tm) platform
  * ===================================================
  * 
- * (C)opyright 2013-2021, by Object Refinery Limited.  All rights reserved.
+ * (C)opyright 2013-2021, by David Gilbert.  All rights reserved.
  *
  * Project Info:  http://www.jfree.org/jfreesvg/index.html
  * 


=====================================
src/test/java/org/jfree/svg/TestGeneral.java
=====================================
@@ -2,7 +2,7 @@
  * JFreeSVG : an SVG library for the Java(tm) platform
  * ===================================================
  * 
- * (C)opyright 2013-2021, by Object Refinery Limited.  All rights reserved.
+ * (C)opyright 2013-2021, by David Gilbert.  All rights reserved.
  *
  * Project Info:  http://www.jfree.org/jfreesvg/index.html
  * 


=====================================
src/test/java/org/jfree/svg/TestSVGGraphics2D.java
=====================================
@@ -2,7 +2,7 @@
  * JFreeSVG : an SVG library for the Java(tm) platform
  * ===================================================
  * 
- * (C)opyright 2013-2021, by Object Refinery Limited.  All rights reserved.
+ * (C)opyright 2013-2021, by David Gilbert.  All rights reserved.
  *
  * Project Info:  http://www.jfree.org/jfreesvg/index.html
  * 
@@ -314,7 +314,11 @@ public class TestSVGGraphics2D {
         assertEquals(new Rectangle2D.Double(1.0, 1.0, 1.0, 1.0), 
                 this.g2.getClip().getBounds2D());
     }
-    
+
+    /**
+     * Check that if the user clip is non-intersecting with the existing clip, then
+     * the clip is empty.
+     */
     @Test
     public void checkNonIntersectingClip() {
         Rectangle2D r = new Rectangle2D.Double(1.0, 1.0, 3.0, 3.0);
@@ -447,7 +451,7 @@ public class TestSVGGraphics2D {
         this.g2.clipRect(2, 1, 4, -2);
         assertTrue(this.g2.getClip().getBounds2D().isEmpty());    
     }
-    
+
     @Test
     public void checkDrawStringWithNullString() {
         try {
@@ -818,7 +822,54 @@ public class TestSVGGraphics2D {
         assertTrue(g2.drawImage(img, 1, 2, 10, -10, null)); 
     }
 
-    /** 
+    /**
+     * Check that the color is not changed by setting a clip.  In some
+     * implementations the clip is saved/restored as part of the overall
+     * graphics state so clipping can impact other attributes.
+     */
+    @Test
+    public void checkColorAfterSetClip() {
+        this.g2.setColor(Color.RED);
+        assertEquals(Color.RED, this.g2.getColor());
+        this.g2.setClip(0, 0, 10, 10);
+        assertEquals(Color.RED, this.g2.getColor());
+        this.g2.setColor(Color.BLUE);
+        assertEquals(Color.BLUE, this.g2.getColor());
+        this.g2.setClip(0, 0, 20, 20);
+        assertEquals(Color.BLUE, this.g2.getColor());
+    }
+
+    /**
+     * See https://github.com/jfree/fxgraphics2d/issues/6
+     */
+    @Test
+    public void checkFontAfterSetClip() {
+        this.g2.setFont(new Font(Font.DIALOG, Font.BOLD, 12));
+        assertEquals(new Font(Font.DIALOG, Font.BOLD, 12), this.g2.getFont());
+        this.g2.setClip(0, 0, 10, 10);
+        assertEquals(new Font(Font.DIALOG, Font.BOLD, 12), this.g2.getFont());
+        this.g2.setFont(new Font(Font.DIALOG, Font.BOLD, 24));
+        assertEquals(new Font(Font.DIALOG, Font.BOLD, 24), this.g2.getFont());
+        this.g2.setClip(0, 0, 20, 20);
+        assertEquals(new Font(Font.DIALOG, Font.BOLD, 24), this.g2.getFont());
+    }
+
+    /**
+     * See https://github.com/jfree/fxgraphics2d/issues/6
+     */
+    @Test
+    public void checkStrokeAfterSetClip() {
+        this.g2.setStroke(new BasicStroke(1.0f));
+        assertEquals(new BasicStroke(1.0f), this.g2.getStroke());
+        this.g2.setClip(0, 0, 10, 10);
+        assertEquals(new BasicStroke(1.0f), this.g2.getStroke());
+        this.g2.setStroke(new BasicStroke(2.0f));
+        assertEquals(new BasicStroke(2.0f), this.g2.getStroke());
+        this.g2.setClip(0, 0, 20, 20);
+        assertEquals(new BasicStroke(2.0f), this.g2.getStroke());
+    }
+
+    /**
      * A test to check whether setting a transform on the Graphics2D affects
      * the results of text measurements performed via getFontMetrics().
      */
@@ -852,4 +903,42 @@ public class TestSVGGraphics2D {
         assertTrue(true); // won't get here if there's an exception above                
     }
 
+    /**
+     * Filling and/or stroking a Rectangle2D with a negative width will not display anything but
+     * should not throw an exception.
+     */
+    @Test
+    public void fillOrStrokeRectangleWithNegativeWidthMustNotFail() {
+        g2.draw(new Rectangle2D.Double(0, 0, 0, 10));
+        g2.draw(new Rectangle2D.Double(0, 0, -10, 10));
+        g2.fill(new Rectangle2D.Double(0, 0, 0, 10));
+        g2.fill(new Rectangle2D.Double(0, 0, -10, 10));
+        assertTrue(true); // won't get here if there's an exception above
+    }
+
+    /**
+     * Filling and/or stroking a Rectangle2D with a negative height will not display anything but
+     * should not throw an exception.
+     */
+    @Test
+    public void fillOrStrokeRectangleWithNegativeHeightMustNotFail() {
+        g2.draw(new Rectangle2D.Double(0, 0, 0, 10));
+        g2.draw(new Rectangle2D.Double(0, 0, -10, 10));
+        g2.fill(new Rectangle2D.Double(0, 0, 0, 10));
+        g2.fill(new Rectangle2D.Double(0, 0, -10, 10));
+        assertTrue(true); // won't get here if there's an exception above
+    }
+
+    @Test
+    public void checkClipAfterCreate() {
+        this.g2.setClip(10, 20, 30, 40);
+        assertEquals(new Rectangle(10, 20, 30, 40), g2.getClip().getBounds2D());
+
+        Graphics2D g2copy = (Graphics2D) this.g2.create();
+        g2copy.clipRect(11, 21, 10, 10);
+        assertEquals(new Rectangle(11, 21, 10, 10), g2copy.getClip().getBounds2D());
+        g2copy.dispose();
+        assertEquals(new Rectangle(10, 20, 30, 40), g2.getClip().getBounds2D());
+    }
+
 }


=====================================
src/test/java/org/jfree/svg/util/ArgsTest.java
=====================================
@@ -2,7 +2,7 @@
  * JFreeSVG : an SVG library for the Java(tm) platform
  * ===================================================
  * 
- * (C)opyright 2013-2021, by Object Refinery Limited.  All rights reserved.
+ * (C)opyright 2013-2021, by David Gilbert.  All rights reserved.
  *
  * Project Info:  http://www.jfree.org/jfreesvg/index.html
  * 



View it on GitLab: https://salsa.debian.org/java-team/jfreesvg/-/commit/f3764346d9c67aba099676cde26959529fc4955b

-- 
View it on GitLab: https://salsa.debian.org/java-team/jfreesvg/-/commit/f3764346d9c67aba099676cde26959529fc4955b
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20211221/d60b7e28/attachment.htm>


More information about the pkg-java-commits mailing list