diff --git a/README.md b/README.md
index c8e9ca3..39838ce 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
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 David Gilbert. All rights reserved.
@@ -31,7 +31,7 @@ JFreeSVG is published to the Central Repository. You can include it in your pro
org.jfreeorg.jfree.svg
- 5.0.1
+ 5.0.2
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
org.jfreejfreesvg
- 3.4.1
+ 3.4.2
Build
@@ -75,7 +75,8 @@ JFreeSVG is free software under the terms of the GNU General Public License vers
Change History
--------------
-Version 5.0.2 (not yet released)
+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)
diff --git a/jfreesvg.svg b/jfreesvg.svg
index aca864d..7274b7d 100644
--- a/jfreesvg.svg
+++ b/jfreesvg.svg
@@ -1,2 +1,2 @@
-
+
diff --git a/pom.xml b/pom.xml
index e7c9512..5f78d4a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
org.jfreeorg.jfree.svg
- 5.0.2-SNAPSHOT
+ 5.0.2jarJFreeSVG
diff --git a/src/main/java/org/jfree/svg/SVGGraphics2D.java b/src/main/java/org/jfree/svg/SVGGraphics2D.java
index ffdcf3f..d996c8a 100644
--- a/src/main/java/org/jfree/svg/SVGGraphics2D.java
+++ b/src/main/java/org/jfree/svg/SVGGraphics2D.java
@@ -52,6 +52,7 @@
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 @@ private String getSVGFontStyle() {
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();
}