diff --git a/build.sh b/build.sh
index 05e87db..d0938ee 100755
--- a/build.sh
+++ b/build.sh
@@ -10,24 +10,16 @@ while test ! -z "$1" ; do
case "$1" in
-major*)
(cd $bDIR && mvn build-helper:parse-version versions:set \
- -DnewVersion="\${parsedVersion.nextMajorVersion}.1.0" ) || exit 1
+ -DnewVersion="\${parsedVersion.nextMajorVersion}.1.\${parsedVersion.nextIncrementalVersion}" ) || exit 1
;;
-minor*)
(cd $bDIR && mvn build-helper:parse-version versions:set \
- -DnewVersion="\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.0" ) || exit 1
+ -DnewVersion="\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.\${parsedVersion.nextIncrementalVersion}" ) || exit 1
;;
-release*)
(cd $bDIR && mvn -X build-helper:parse-version versions:set \
-DnewVersion="\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}" ) || exit 1
;;
- -build*)
- (cd $bDIR && mvn -X buildnumber:create build-helper:parse-version versions:set \
- -DnewVersion="\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.incrementalVersion}-\${buildNumber}" ) || exit 1
- ;;
- -snapshot*)
- (cd $bDIR && mvn -X buildnumber:create build-helper:parse-version versions:set \
- -DnewVersion="\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.incrementalVersion}-rc$bDATE" ) || exit 1
- ;;
-clean*)
(cd $bDIR && mvn clean $OPTS -U) || exit 1
;;
@@ -38,7 +30,8 @@ while test ! -z "$1" ; do
(cd $bDIR && mvn -N versions:update-child-modules) || exit 1
;;
-install*)
- (cd $bDIR && mvn install $OPTS) || exit 1
+ (cd $bDIR && mvn clean install $OPTS) || exit 1
+ (test -e ~/bin/template-cli.sh && cd $bDIR && cp template-cli/target/bin/template-cli.*.sh.bin ~/bin/template-cli.sh)
;;
*) echo "unknow option ..."
;;
diff --git a/buildNumber.properties b/buildNumber.properties
index a7f1d1d..4995140 100644
--- a/buildNumber.properties
+++ b/buildNumber.properties
@@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file
-#Mon Mar 22 12:18:11 CET 2021
-buildNumber=328
+#Wed Mar 31 19:51:21 CEST 2021
+buildNumber=340
diff --git a/examples/check.fm b/examples/check.fm
new file mode 100644
index 0000000..3e65d06
--- /dev/null
+++ b/examples/check.fm
@@ -0,0 +1,6 @@
+<#if _.checkBoolean('on')>
+ON
+#if>
+<#if _.checkBoolean('off')>
+OFF
+#if>
\ No newline at end of file
diff --git a/examples/gfx.groovy b/examples/gfx.groovy
index 044f26f..29577b6 100644
--- a/examples/gfx.groovy
+++ b/examples/gfx.groovy
@@ -1,6 +1,6 @@
-import com.github.terefang.imageutil.PixelImage;
-import com.github.terefang.imageutil.SvgImage;
-import com.github.terefang.imageutil.ImageUtil;
+import com.github.terefang.jmelange.image.PixelImage;
+import com.github.terefang.jmelange.image.SvgImage;
+import com.github.terefang.jmelange.util.ImageUtil;
SvgImage _im = SvgImage.create(200, 200);
diff --git a/pom.xml b/pom.xml
index 9812fab..37fd70d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
com.github.terefang.template
template
- 2021.4.25
+ 2021.4.26
template-cli
template-maven-plugin
@@ -29,6 +29,7 @@
3.6.3
${maven.build.timestamp}
yyyyMMdd'.'HHmm
+ 2021.1.1
diff --git a/template-cli/buildNumber.properties b/template-cli/buildNumber.properties
index 5db0201..357396f 100644
--- a/template-cli/buildNumber.properties
+++ b/template-cli/buildNumber.properties
@@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file
-#Mon Mar 22 12:18:22 CET 2021
-buildNumber=323
+#Wed Mar 31 19:51:31 CEST 2021
+buildNumber=331
diff --git a/template-cli/pom.xml b/template-cli/pom.xml
index 41dc09d..a487257 100644
--- a/template-cli/pom.xml
+++ b/template-cli/pom.xml
@@ -5,7 +5,7 @@
template
com.github.terefang.template
- 2021.4.25
+ 2021.4.26
4.0.0
diff --git a/template-cli/src/test/java/TestFM.java b/template-cli/src/test/java/TestFM.java
new file mode 100644
index 0000000..07bf7b6
--- /dev/null
+++ b/template-cli/src/test/java/TestFM.java
@@ -0,0 +1,12 @@
+import com.github.terefang.template_cli.TemplateCliMain;
+
+public class TestFM {
+ static String[] ARGS = {
+ "-T", "FREEMARKER", "-M", "STD",
+ "-D", "examples/check.fm.out",
+ "-S", "examples/check.fm",
+ "--additional-variables", "_out_dir=examples" };
+ public static void main(String[] args) {
+ TemplateCliMain.main(ARGS);
+ }
+}
diff --git a/template-cli/template-cli.iml b/template-cli/template-cli.iml
index c9cbf28..a738997 100644
--- a/template-cli/template-cli.iml
+++ b/template-cli/template-cli.iml
@@ -12,12 +12,20 @@
+
+
+
+
+
+
+
+
+
-
@@ -63,10 +71,6 @@
-
-
-
-
diff --git a/template-maven-plugin/buildNumber.properties b/template-maven-plugin/buildNumber.properties
index a7f1d1d..1b3ddc7 100644
--- a/template-maven-plugin/buildNumber.properties
+++ b/template-maven-plugin/buildNumber.properties
@@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file
-#Mon Mar 22 12:18:11 CET 2021
-buildNumber=328
+#Wed Mar 31 19:51:22 CEST 2021
+buildNumber=340
diff --git a/template-maven-plugin/pom.xml b/template-maven-plugin/pom.xml
index df60a47..f3dd4b0 100644
--- a/template-maven-plugin/pom.xml
+++ b/template-maven-plugin/pom.xml
@@ -5,7 +5,7 @@
template
com.github.terefang.template
- 2021.4.25
+ 2021.4.26
4.0.0
@@ -14,6 +14,11 @@
maven-plugin
+
+ com.github.terefang.jmelange
+ utils-jmelange
+ ${version.jmelange}
+
org.soulwing.snmp
@@ -166,16 +171,6 @@
plexus-utils
3.3.0
-
- org.jfree
- jfreesvg
- 3.4
-
-
- de.rototor.pdfbox
- graphics2d
- 0.31
-
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/concat_maven_plugin/ConcatMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/concat_maven_plugin/ConcatMojo.java
index a38d1db..ce26e5d 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/concat_maven_plugin/ConcatMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/concat_maven_plugin/ConcatMojo.java
@@ -13,7 +13,6 @@
import org.codehaus.plexus.util.StringUtils;
import java.io.*;
-import java.util.ArrayDeque;
import java.util.Arrays;
@Mojo(name = "concat", defaultPhase = LifecyclePhase.GENERATE_RESOURCES)
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/convert_maven_plugin/ToPdataMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/convert_maven_plugin/ToPdataMojo.java
index aa9de93..70c5289 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/convert_maven_plugin/ToPdataMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/convert_maven_plugin/ToPdataMojo.java
@@ -1,7 +1,7 @@
package com.github.terefang.convert_maven_plugin;
+import com.github.terefang.jmelange.pdata.PdataWriter;
import com.github.terefang.template_maven_plugin.util.ContextUtil;
-import com.github.terefang.template_maven_plugin.util.PdxWriter;
import lombok.Data;
import lombok.SneakyThrows;
import org.apache.maven.plugin.AbstractMojo;
@@ -11,7 +11,6 @@
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.codehaus.plexus.util.DirectoryScanner;
-import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.StringUtils;
import java.io.*;
@@ -109,11 +108,11 @@ public static void convertToPdata(File _from, File _to)
Map _data = ContextUtil.loadContextFrom(_from);
if(_to == null)
{
- PdxWriter.writeTo(_data, new OutputStreamWriter(System.out));
+ PdataWriter.writeTo(_data, new OutputStreamWriter(System.out));
}
else
{
- PdxWriter.writeTo(_data, _to);
+ PdataWriter.writeTo(_data, _to);
}
}
}
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/AbstractGfxInterface.java b/template-maven-plugin/src/main/java/com/github/terefang/imageutil/AbstractGfxInterface.java
deleted file mode 100644
index 2448c50..0000000
--- a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/AbstractGfxInterface.java
+++ /dev/null
@@ -1,265 +0,0 @@
-package com.github.terefang.imageutil;
-
-import org.jfree.graphics2d.svg.SVGGraphics2D;
-import org.jfree.graphics2d.svg.SVGHints;
-
-import java.awt.*;
-import java.awt.font.FontRenderContext;
-import java.awt.font.GlyphVector;
-import java.awt.geom.AffineTransform;
-import java.awt.image.BufferedImage;
-import java.awt.image.BufferedImageOp;
-import java.awt.image.ImageObserver;
-import java.awt.image.RenderedImage;
-import java.awt.image.renderable.RenderableImage;
-import java.text.AttributedCharacterIterator;
-import java.util.ArrayDeque;
-import java.util.Deque;
-import java.util.Map;
-import java.util.UUID;
-
-public abstract class AbstractGfxInterface implements GfxInterface, StackedGfxInterface
-{
- Deque _queue = new ArrayDeque<>();
- Graphics2D _current;
-
- @Override
- public StackedGfxInterface getStackedGfxInterface()
- {
- this.beginDraw();
- return this;
- }
-
- @Override
- public Graphics2D getCurrentGraphics2D()
- {
- if(_current!=null) return _current;
- if(!_queue.isEmpty())
- {
- return (_current = _queue.poll());
- }
- return (_current = getG2d());
- }
-
- public void dispose()
- {
- this.endDraw();
- }
-
- public void beginDraw()
- {
- beginDraw(UUID.randomUUID().toString());
- }
-
- @Override
- public void beginDraw(String _id) {
- if(_current!=null)
- {
- _queue.push(_current);
- _current = (Graphics2D) _current.create();
- }
- else
- {
- getCurrentGraphics2D();
- }
-
- if(_current instanceof SVGGraphics2D)
- {
- ((SVGGraphics2D)_current).setRenderingHint(SVGHints.KEY_BEGIN_GROUP, _id);
- }
- }
-
- @Override
- public void endDraw() {
- if(_current!=null)
- {
- _current.dispose();
- }
- _current = _queue.poll();
-
- if(_current instanceof SVGGraphics2D)
- {
- ((SVGGraphics2D)_current).setRenderingHint(SVGHints.KEY_END_GROUP, "true");
- }
- }
-
- @Override
- public void beginText() {
- if(_current!=null)
- {
- _queue.push(_current);
- _current = (Graphics2D) _current.create();
- }
- else
- {
- getCurrentGraphics2D();
- }
- }
-
- @Override
- public void endText() {
- if(_current!=null)
- {
- _current.dispose();
- }
- _current = _queue.poll();
- }
-
-
- public void draw3DRect(int x, int y, int width, int height, boolean raised) {
- _current.draw3DRect(x, y, width, height, raised);
- }
-
- public void fill3DRect(int x, int y, int width, int height, boolean raised) {
- _current.fill3DRect(x, y, width, height, raised);
- }
-
- public void drawString(String str, int x, int y) {
- _current.drawString(str, x, y);
- }
-
- public void drawString(String str, float x, float y) {
- _current.drawString(str, x, y);
- }
-
- public void setComposite(Composite comp) {
- _current.setComposite(comp);
- }
-
- public void setPaint(Paint paint) {
- _current.setPaint(paint);
- }
-
- public void setStroke(Stroke s) {
- _current.setStroke(s);
- }
-
- public void translate(int x, int y) {
- _current.translate(x, y);
- }
-
- public void translate(double tx, double ty) {
- _current.translate(tx, ty);
- }
-
- public void rotate(double theta) {
- _current.rotate(theta);
- }
-
- public void rotate(double theta, double x, double y) {
- _current.rotate(theta, x, y);
- }
-
- public void scale(double sx, double sy) {
- _current.scale(sx, sy);
- }
-
- public void shear(double shx, double shy) {
- _current.shear(shx, shy);
- }
-
- public void setBackground(int _color) {
- _current.setBackground(ImageUtil.createColor(_color));
- }
-
- public void clip(Shape s) {
- _current.clip(s);
- }
-
- public void setColor(long _color) {
- _current.setColor(ImageUtil.createColor(_color));
- }
-
- public void setPaintMode() {
- _current.setPaintMode();
- }
-
- public void setFont(Font font) {
- _current.setFont(font);
- }
-
- public void clipRect(int x, int y, int width, int height) {
- _current.clipRect(x, y, width, height);
- }
-
- public void setClip(int x, int y, int width, int height) {
- _current.setClip(x, y, width, height);
- }
-
- public void drawLine(int x1, int y1, int x2, int y2) {
- _current.drawLine(x1, y1, x2, y2);
- }
-
- public void fillRect(int x, int y, int width, int height) {
- _current.fillRect(x, y, width, height);
- }
-
- public void drawRect(int x, int y, int width, int height) {
- _current.drawRect(x, y, width, height);
- }
-
- public void clearRect(int x, int y, int width, int height) {
- _current.clearRect(x, y, width, height);
- }
-
- public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) {
- _current.drawRoundRect(x, y, width, height, arcWidth, arcHeight);
- }
-
- public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) {
- _current.fillRoundRect(x, y, width, height, arcWidth, arcHeight);
- }
-
- public void drawOval(int x, int y, int width, int height) {
- _current.drawOval(x, y, width, height);
- }
-
- public void fillOval(int x, int y, int width, int height) {
- _current.fillOval(x, y, width, height);
- }
-
- public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) {
- _current.drawArc(x, y, width, height, startAngle, arcAngle);
- }
-
- public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) {
- _current.fillArc(x, y, width, height, startAngle, arcAngle);
- }
-
- public void drawPolyline(int[] points) {
- int _np = points.length/2;
- int[] _x = new int[_np];
- int[] _y = new int[_np];
- for(int _i = 0; _i<_np; _i++)
- {
- _x[_i] = points[_i*2];
- _y[_i] = points[(_i*2)+1];
- }
- _current.drawPolyline(_x, _y, _np);
- }
-
- public void drawPolygon(int[] points) {
- int _np = points.length/2;
- int[] _x = new int[_np];
- int[] _y = new int[_np];
- for(int _i = 0; _i<_np; _i++)
- {
- _x[_i] = points[_i*2];
- _y[_i] = points[(_i*2)+1];
- }
- _current.drawPolygon(_x, _y, _np);
- }
-
- public void fillPolygon(int[] points) {
- int _np = points.length/2;
- int[] _x = new int[_np];
- int[] _y = new int[_np];
- for(int _i = 0; _i<_np; _i++)
- {
- _x[_i] = points[_i*2];
- _y[_i] = points[(_i*2)+1];
- }
- _current.fillPolygon(_x, _y, _np);
- }
-
-}
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/G2dProxy.java b/template-maven-plugin/src/main/java/com/github/terefang/imageutil/G2dProxy.java
deleted file mode 100644
index 1dc3562..0000000
--- a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/G2dProxy.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package com.github.terefang.imageutil;
-
-import org.jfree.graphics2d.svg.SVGGraphics2D;
-import org.jfree.graphics2d.svg.SVGHints;
-
-import java.awt.*;
-import java.io.File;
-import java.io.OutputStream;
-import java.util.UUID;
-
-public class G2dProxy implements GfxSubInterface
-{
- Graphics2D _g2d;
- GfxInterface _g;
- public static final GfxSubInterface create(GfxInterface _g, String _id)
- {
- G2dProxy _p = new G2dProxy();
- _p._g2d = _g.getG2d();
- _p._g=_g;
-
- if(_p._g2d instanceof SVGGraphics2D)
- {
- ((SVGGraphics2D)_p._g2d).setRenderingHint(SVGHints.KEY_BEGIN_GROUP, _id);
- }
- return _p;
- }
-
- public static final GfxSubInterface create(GfxInterface _g)
- {
- return create(_g,UUID.randomUUID().toString());
- }
-
- @Override
- public Graphics2D getG2d() {
- return (Graphics2D) _g2d.create();
- }
-
- @Override
- public String beginGroup() {
- return this._g.beginGroup();
- }
-
- @Override
- public String beginGroup(String _id) {
- return this._g.beginGroup(_id);
- }
-
- @Override
- public void endGroup() {
- this._g.endGroup();
- }
-
- @Override
- public void gSet(int _x, int _y, long _color) {
- _g.gSet(_x, _y, _color);
- }
-
- @Override
- public int gGet(int _x, int _y) {
- return _g.gGet(_x, _y);
- }
-
- @Override
- public void save(File _out) {
-
- }
-
- @Override
- public void save(OutputStream _out) {
-
- }
-
- @Override
- public StackedGfxInterface getStackedGfxInterface() {
- return _g.getStackedGfxInterface();
- }
-
- @Override
- public void dispose()
- {
- if(this._g2d instanceof SVGGraphics2D)
- {
- ((SVGGraphics2D)this._g2d).setRenderingHint(SVGHints.KEY_END_GROUP, "true");
- }
- this._g2d.dispose();
- this._g2d=null;
- }
-}
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/GfxInterface.java b/template-maven-plugin/src/main/java/com/github/terefang/imageutil/GfxInterface.java
deleted file mode 100644
index 021e914..0000000
--- a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/GfxInterface.java
+++ /dev/null
@@ -1,401 +0,0 @@
-package com.github.terefang.imageutil;
-
-import java.awt.*;
-import java.io.File;
-import java.io.OutputStream;
-
-public interface GfxInterface
-{
- public Graphics2D getG2d();
- default GfxInterface getSub()
- {
- return G2dProxy.create(this);
- }
-
- public String beginGroup();
-
- public String beginGroup(String _id);
-
- public void endGroup();
-
- default GfxInterface getSub(String _id)
- {
- return G2dProxy.create(this, _id);
- }
-
- default Font getFont(String _name, int _size)
- {
- return ImageUtil.getFont(_name, _size);
- }
-
- default Font getPSFont(String _name, int _size)
- {
- Font _font = ImageUtil.getPSFont(new File(_name), _size);
- if(this instanceof PdfImage)
- {
- ((PdfImage)this).registerFont(_font, new File(_name));
- }
- return _font;
- }
-
- default Font getTTFont(String _name, int _size)
- {
- Font _font = ImageUtil.getTTFont(new File(_name), _size);
- if(this instanceof PdfImage)
- {
- ((PdfImage)this).registerFont(_font, new File(_name));
- }
- return _font;
- }
-
- default Font getFont(String _name, float _size)
- {
- return ImageUtil.getFont(_name, _size);
- }
-
- default Font getPSFont(String _name, float _size)
- {
- Font _font = ImageUtil.getPSFont(new File(_name), _size);
- if(this instanceof PdfImage)
- {
- ((PdfImage)this).registerFont(_font, new File(_name));
- }
- return _font;
- }
-
- default Font getTTFont(String _name, float _size)
- {
- Font _font = ImageUtil.getTTFont(new File(_name), _size);
- if(this instanceof PdfImage)
- {
- ((PdfImage)this).registerFont(_font, new File(_name));
- }
- return _font;
- }
-
- public void gSet(int _x, int _y, long _color);
- public int gGet(int _x, int _y);
-
- default void gLine(int _x1, int _y1, int _x2, int _y2, long _color)
- {
- gLine(_x1, _y1, _x2, _y2, 1, _color);
- }
-
- default void gLine(int _x1, int _y1, int _x2, int _y2, float _lineWidth, long _color)
- {
- Graphics2D _g = (Graphics2D) this.getG2d();
- _g.setPaint(ImageUtil.createColor(_color));
- Stroke _s = new BasicStroke(_lineWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0);
- _g.setStroke(_s);
- _g.drawLine(_x1, _y1, _x2, _y2);
- _g.dispose();
- }
-
- default void gDashedLine(int _x1, int _y1, int _x2, int _y2, long _color, float _shape)
- {
- gDashedLine(_x1, _y1, _x2, _y2, 1, _color, new float[] {_shape});
- }
-
- default void gDashedLine(int _x1, int _y1, int _x2, int _y2, long _color, float... _shape)
- {
- gDashedLine(_x1, _y1, _x2, _y2, 1, _color, _shape);
- }
-
- default void gDashedLine(int _x1, int _y1, int _x2, int _y2, float _lineWidth, long _color, float _shape)
- {
- gDashedLine(_x1, _y1, _x2, _y2, _lineWidth, _color, new float[] {_shape});
- }
-
- default void gDashedLine(int _x1, int _y1, int _x2, int _y2, float _lineWidth, long _color, float... _shape)
- {
- Graphics2D _g = (Graphics2D) this.getG2d();
- _g.setPaint(ImageUtil.createColor(_color));
- Stroke _dashed = new BasicStroke(_lineWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, _shape, 0);
- _g.setStroke(_dashed);
- _g.drawLine(_x1, _y1, _x2, _y2);
- _g.dispose();
- }
-
- default void gRectangle(int _x1, int _y1, int _x2, int _y2, long _color)
- {
- gRectangle(false, _x1, _y1, _x2, _y2, 1, _color, null);
- }
-
- default void gRectangle(int _x1, int _y1, int _x2, int _y2, float _lineWidth, long _color, float _dash)
- {
- gRectangle(false, _x1, _y1, _x2, _y2, _lineWidth, _color, new float[] {_dash});
- }
-
- default void gRectangle(int _x1, int _y1, int _x2, int _y2, float _lineWidth, long _color, float[] _dash)
- {
- gRectangle(false, _x1, _y1, _x2, _y2, _lineWidth, _color, null);
- }
-
- default void gRectangle(boolean _fill, int _x1, int _y1, int _x2, int _y2, float _lineWidth, long _color, float[] _dash)
- {
- Graphics2D _g = (Graphics2D) this.getG2d();
- _g.setPaint(ImageUtil.createColor(_color));
- if(!_fill)
- {
- Stroke _s = null;
- if(_dash == null || _dash.length==0)
- {
- _s = new BasicStroke(_lineWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0);
- }
- else
- {
- _s = new BasicStroke(_lineWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, _dash, 0f);
- }
- _g.setStroke(_s);
- _g.drawRect(_x1,_y1, _x2-_x1, _y2-_y1);
- }
- else
- {
- _g.fillRect(_x1,_y1, _x2-_x1, _y2-_y1);
- }
- _g.dispose();
- }
-
- default void gFilledRectangle(int _x1, int _y1, int _x2, int _y2, long _color)
- {
- gRectangle(true, _x1, _y1, _x2, _y2, 1, _color, null);
- }
-
- default void gFilledRectangle(int _x1, int _y1, int _x2, int _y2, float _lineWidth, long _color)
- {
- gRectangle(true, _x1, _y1, _x2, _y2, _lineWidth, _color, null);
- }
-
- default void gPolygon(long _color, int... _points)
- {
- gPolygon(1, _color, null, _points);
- }
-
- default void gPolygon(float _lineWidth, long _color, float[] _dash, int... _points)
- {
- this.gPolygon(false,_lineWidth, _color, _dash, _points);
- }
-
- default void gPolygon(boolean _fill, float _lineWidth, long _color, float[] _dash, int... _points)
- {
- Graphics2D _g = (Graphics2D) this.getG2d();
- _g.setPaint(ImageUtil.createColor(_color));
- Polygon _p = new Polygon();
- for(int _i = 0; _i<_points.length; _i+=2)
- {
- _p.addPoint(_points[_i], _points[_i+1]);
- }
- if(!_fill)
- {
- Stroke _s = null;
- if(_dash == null || _dash.length==0)
- {
- _s = new BasicStroke(_lineWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0);
- }
- else
- {
- _s = new BasicStroke(_lineWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, _dash, 0f);
- }
- _g.setStroke(_s);
- _g.drawPolygon(_p);
- }
- else
- {
- _g.fillPolygon(_p);
- }
- _g.dispose();
- }
-
- default void gFilledPolygon(long _color, int... _points)
- {
- gFilledPolygon(1, _color, _points);
- }
-
- default void gFilledPolygon(float _lineWidth, long _color, int... _points)
- {
- this.gPolygon(true,_lineWidth, _color, null, _points);
- }
-
- default void gPolyline(long _color, int... _points)
- {
- gPolyline(1, _color, null, _points);
- }
-
- default void gPolyline(float _lineWidth, long _color, int... _points)
- {
- gPolyline(_lineWidth, _color, null, _points);
- }
-
- default void gPolyline(float _lineWidth, long _color, float[] _dash, int... _points)
- {
- Graphics2D _g = (Graphics2D) this.getG2d();
- _g.setPaint(ImageUtil.createColor(_color));
- Stroke _s = null;
- if(_dash == null || _dash.length==0)
- {
- _s = new BasicStroke(_lineWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0);
- }
- else
- {
- _s = new BasicStroke(_lineWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, _dash, 0f);
- }
- _g.setStroke(_s);
- int _lx = _points[0];
- int _ly = _points[1];
- for(int _i = 2; _i<_points.length; _i+=2)
- {
- _g.drawLine(_lx,_ly,_points[_i], _points[_i+1]);
- _lx = _points[_i];
- _ly = _points[_i+1];
- }
- _g.dispose();
- }
-
- default void gCircle(int _cx, int _cy, int _r, long _color)
- {
- this.gOval(_cx, _cy, _r, _r, 1, _color, null);
- }
-
- default void gCircle(int _cx, int _cy, int _r, float _lineWidth, long _color)
- {
- this.gOval(_cx, _cy, _r, _r, _lineWidth, _color, null);
- }
-
- default void gCircle(int _cx, int _cy, int _r, float _lineWidth, long _color, float _dash)
- {
- this.gOval(_cx, _cy, _r, _r, _lineWidth, _color, new float[]{ _dash });
- }
-
- default void gCircle(int _cx, int _cy, int _r, float _lineWidth, long _color, float[] _dash)
- {
- this.gOval(false, _cx, _cy, _r, _r, _lineWidth, _color, _dash);
- }
-
- default void gCircle(boolean _fill, int _cx, int _cy, int _r, float _lineWidth, long _color, float _dash)
- {
- this.gOval(_fill, _cx, _cy, _r, _r, _lineWidth, _color, new float[]{ _dash });
- }
-
- default void gCircle(boolean _fill, int _cx, int _cy, int _r, float _lineWidth, long _color, float[] _dash)
- {
- this.gOval(_fill, _cx, _cy, _r, _r, _lineWidth, _color, _dash);
- }
-
- default void gFilledCircle(int _cx, int _cy, int _r, long _color)
- {
- this.gCircle(true, _cx, _cy, _r, 1, _color, null);
- }
-
- default void gOval(int _cx, int _cy, int _ra, int _rb, long _color)
- {
- this.gOval(_cx, _cy, _ra, _rb, 1, _color, null);
- }
-
- default void gOval(int _cx, int _cy, int _ra, int _rb, float _lineWidth, long _color, float _dash)
- {
- this.gOval(false, _cx, _cy, _ra, _rb, _lineWidth, _color, new float[]{ _dash });
- }
-
- default void gOval(int _cx, int _cy, int _ra, int _rb, float _lineWidth, long _color, float[] _dash)
- {
- this.gOval(false, _cx, _cy, _ra, _rb, 1, _color, null);
- }
-
- default void gOval(boolean _fill, int _cx, int _cy, int _ra, int _rb, float _lineWidth, long _color, float _dash)
- {
- this.gOval(_fill, _cx, _cy, _ra, _rb, _lineWidth, _color, new float[]{ _dash });
- }
-
- default void gOval(boolean _fill, int _cx, int _cy, int _ra, int _rb, float _lineWidth, long _color, float[] _dash)
- {
- Graphics2D _g = (Graphics2D) this.getG2d();
- _g.setPaint(ImageUtil.createColor(_color));
- if(!_fill)
- {
- Stroke _s = null;
- if(_dash == null || _dash.length==0)
- {
- _s = new BasicStroke(_lineWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0);
- }
- else
- {
- _s = new BasicStroke(_lineWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, _dash, 0f);
- }
- _g.setStroke(_s);
- _g.drawOval(_cx-_ra, _cy-_rb, _ra*2,_rb*2);
- }
- else
- {
- _g.fillOval(_cx-_ra, _cy-_rb,_ra*2,_rb*2);
- }
- _g.dispose();
- }
-
- default void gFilledOval(int _cx, int _cy, int _ra, int _rb, long _color)
- {
- this.gOval(true, _cx, _cy, _ra, _rb, 1, _color, null);
- }
-
- default void gArc(int _cx, int _cy, int _ra, int _rb, int _as, int _ae, long _color)
- {
- gArc(false, _cx, _cy, _ra, _rb, _as, _ae,1, _color, null);
- }
-
- default void gArc(boolean _fill, int _cx, int _cy, int _ra, int _rb, int _as, int _ae, float _lineWidth, long _color, float _dash)
- {
- gArc(_fill, _cx, _cy, _ra, _rb, _as, _ae,1, _color, new float[] { _dash });
- }
-
- default void gArc(boolean _fill, int _cx, int _cy, int _ra, int _rb, int _as, int _ae, float _lineWidth, long _color, float[] _dash)
- {
- Graphics2D _g = (Graphics2D) this.getG2d();
- _g.setPaint(ImageUtil.createColor(_color));
- if(!_fill)
- {
- Stroke _s = null;
- if(_dash == null || _dash.length==0)
- {
- _s = new BasicStroke(_lineWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0);
- }
- else
- {
- _s = new BasicStroke(_lineWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, _dash, 0f);
- }
- _g.setStroke(_s);
- _g.drawArc(_cx-_ra, _cy-_rb, _ra*2,_rb*2, _as, _ae-_as);
- }
- else
- {
- _g.fillArc(_cx-_ra, _cy-_rb, _ra*2,_rb*2, _as, _ae-_as);
- }
- _g.dispose();
- }
-
- default void gFilledArc(int _cx, int _cy, int _ra, int _rb, int _as, int _ae, long _color)
- {
- gArc(true, _cx, _cy, _ra, _rb, _as, _ae,1, _color, null);
- }
-
- default void gString(String _font, int _size, int _x, int _y, String _s, long _color)
- {
- Graphics2D _g = (Graphics2D) this.getG2d();
- _g.setPaint(ImageUtil.createColor(_color));
- _g.setFont(ImageUtil.getFont(_font, _size));
- _g.drawString(_s, _x, _y);
- _g.dispose();
- }
-
- default void gString(Font _font, int _x, int _y, String _s, long _color)
- {
- Graphics2D _g = (Graphics2D) this.getG2d();
- _g.setPaint(ImageUtil.createColor(_color));
- _g.setFont(_font);
- _g.drawString(_s, _x, _y);
- _g.dispose();
- }
-
- public void save(File _out);
- public void save(OutputStream _out);
-
- public StackedGfxInterface getStackedGfxInterface();
-}
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/GfxSubInterface.java b/template-maven-plugin/src/main/java/com/github/terefang/imageutil/GfxSubInterface.java
deleted file mode 100644
index 3da2f25..0000000
--- a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/GfxSubInterface.java
+++ /dev/null
@@ -1,6 +0,0 @@
-package com.github.terefang.imageutil;
-
-public interface GfxSubInterface extends GfxInterface
-{
- void dispose();
-}
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/ImageUtil.java b/template-maven-plugin/src/main/java/com/github/terefang/imageutil/ImageUtil.java
deleted file mode 100644
index a91f2d3..0000000
--- a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/ImageUtil.java
+++ /dev/null
@@ -1,134 +0,0 @@
-package com.github.terefang.imageutil;
-
-import lombok.SneakyThrows;
-
-import java.awt.*;
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-
-public class ImageUtil
-{
- public static final int ALPHA_OPAQUE = 0xff000000;
- public static final int ALPHA_MASK = 0xff000000;
- public static final int COLOR_MASK = 0x00ffffff;
- public static final int ALPHA_TRANSPARENT = 0x00000000;
-
- public static final int WHITE = 0xffffffff;
- public static final int BLACK = 0xffffffff;
-
- public static final int RED = 0xffff0000;
- public static final int GREEN = 0xff00ff00;
- public static final int BLUE = 0xff0000ff;
- public static final int YELLOW = 0xffffff00;
- public static final int MAGENTA = 0xffff00ff;
- public static final int CYAN = 0xff00ffff;
-
- public static final int HALF_WHITE = 0x88ffffff;
- public static final int HALF_RED = 0x88ff0000;
- public static final int HALF_GREEN = 0x8800ff00;
- public static final int HALF_BLUE = 0x880000ff;
- public static final int HALF_YELLOW = 0x88ffff00;
- public static final int HALF_MAGENTA = 0x88ff00ff;
- public static final int HALF_CYAN = 0x8800ffff;
-
- public static final Map FONT_MAP = new HashMap<>();
- public static Color createColor(long _color)
- {
- return new Color((int)_color, true);
- }
-
- public static Font getFont(String _name, int _size)
- {
- String _l = String.format("%s/%d", _name, _size);
- if(!FONT_MAP.containsKey(_l))
- {
- Font _awt = Font.getFont(_name);
- if(_awt==null)
- {
- _awt = new Font(_name, Font.PLAIN,_size);
- }
- else
- {
- _awt = _awt.deriveFont((float) _size);
- }
- FONT_MAP.put(_l, _awt);
- }
- return FONT_MAP.get(_l);
- }
-
- @SneakyThrows
- public static Font getTTFont(File _name, int _size)
- {
- String _l = String.format("%s/%d", _name.getName(), _size);
- if(!FONT_MAP.containsKey(_l))
- {
- FONT_MAP.put(_l,Font.createFont(Font.TRUETYPE_FONT, _name).deriveFont((float)_size));
- }
- return FONT_MAP.get(_l);
- }
-
- @SneakyThrows
- public static Font getPSFont(File _name, int _size)
- {
- String _l = String.format("%s/%d", _name.getName(), _size);
- if(!FONT_MAP.containsKey(_l))
- {
- FONT_MAP.put(_l,Font.createFont(Font.TYPE1_FONT, _name).deriveFont((float)_size));
- }
- return FONT_MAP.get(_l);
- }
-
- public static Font getFont(String _name, float _size)
- {
- String _l = String.format("%s/%f", _name, _size);
- if(!FONT_MAP.containsKey(_l))
- {
- Font _awt = Font.getFont(_name);
- if(_awt==null)
- {
- _awt = new Font(_name, Font.PLAIN, (int)_size);
- }
- else
- {
- _awt = _awt.deriveFont(_size);
- }
- FONT_MAP.put(_l, _awt);
- }
- return FONT_MAP.get(_l);
- }
-
- @SneakyThrows
- public static Font getTTFont(File _name, float _size)
- {
- String _l = String.format("%s/%f", _name.getName(), _size);
- if(!FONT_MAP.containsKey(_l))
- {
- FONT_MAP.put(_l,Font.createFont(Font.TRUETYPE_FONT, _name).deriveFont(_size));
- }
- return FONT_MAP.get(_l);
- }
-
- @SneakyThrows
- public static Font getPSFont(File _name, float _size)
- {
- String _l = String.format("%s/%f", _name.getName(), _size);
- if(!FONT_MAP.containsKey(_l))
- {
- FONT_MAP.put(_l,Font.createFont(Font.TYPE1_FONT, _name).deriveFont(_size));
- }
- return FONT_MAP.get(_l);
- }
-
- public static int toColor(float _r, float _g, float _b) {
- return (((0xff) << 24) | (((int) (_r * 255)) << 16) | (((int) (_g * 255)) << 8) | ((int) (_b * 255)));
- }
-
- public static int toColor(float _r, float _g, float _b, float _a) {
- return((((int) (_a * 255)) << 24) | (((int) (_r * 255)) << 16) | (((int) (_g * 255)) << 8) | ((int) (_b * 255)));
- }
-
- public static int toColor(int _rgb, float _a) {
- return((((_rgb)) << 8) | ((int) (_a * 255)));
- }
-}
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/PdfCustomFontTextDrawer.java b/template-maven-plugin/src/main/java/com/github/terefang/imageutil/PdfCustomFontTextDrawer.java
deleted file mode 100644
index 0345a0f..0000000
--- a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/PdfCustomFontTextDrawer.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.github.terefang.imageutil;
-
-import de.rototor.pdfbox.graphics2d.PdfBoxGraphics2DFontTextDrawer;
-import org.apache.fontbox.ttf.OTFParser;
-import org.apache.fontbox.ttf.OpenTypeFont;
-import org.apache.pdfbox.pdmodel.font.PDFont;
-import org.apache.pdfbox.pdmodel.font.PDTrueTypeFont;
-import org.apache.pdfbox.pdmodel.font.PDType0Font;
-
-import java.awt.*;
-import java.awt.font.TextAttribute;
-import java.io.File;
-import java.io.IOException;
-import java.text.AttributedCharacterIterator;
-import java.util.HashMap;
-import java.util.Map;
-
-public class PdfCustomFontTextDrawer extends PdfBoxGraphics2DFontTextDrawer
-{
- Map pfontMap = new HashMap<>();
- Map xfontMap = new HashMap<>();
- PdfStdEncoding ENC = new PdfStdEncoding();
- @Override
- public void registerFont(String fontName, File fontFile) {
- super.registerFont(fontName, fontFile);
- pfontMap.put(fontName, fontFile);
- }
-
- @Override
- public boolean canDrawText(AttributedCharacterIterator iterator, IFontTextDrawerEnv env) throws IOException, FontFormatException
- {
- Font attributeFont = (Font) iterator.getAttribute(TextAttribute.FONT);
-
- if (attributeFont == null) attributeFont = env.getFont();
-
- if(this.pfontMap.containsKey(attributeFont.getFontName()))
- {
- return true;
- }
-
- return super.canDrawText(iterator, env);
- }
-
- @Override
- protected PDFont mapFont(Font font, IFontTextDrawerEnv env)
- throws IOException, FontFormatException {
- // Using the font, especially the font.getFontName() or font.getFamily() to determine which
- // font to use... return null if the font can not be mapped. You can also call registerFont() here.
-
- // Default lookup in the registered fonts
- String fontName = font.getFontName();
- if(this.pfontMap.containsKey(fontName))
- {
- if(!this.xfontMap.containsKey(fontName))
- {
- try
- {
- PDFont pdFont = PDType0Font.load(env.getDocument(), this.pfontMap.get(fontName));
- this.xfontMap.put(fontName, pdFont);
- }
- catch(Exception _xe)
- {
- OTFParser parser = new OTFParser(false, true);
- OpenTypeFont _font = parser.parse(this.pfontMap.get(fontName));
- PDFont pdFont = PDTrueTypeFont.load(env.getDocument(), _font, ENC);
- this.xfontMap.put(fontName, pdFont);
- }
- }
- return this.xfontMap.get(fontName);
- }
-
- return super.mapFont(font, env);
- }
-}
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/PdfImage.java b/template-maven-plugin/src/main/java/com/github/terefang/imageutil/PdfImage.java
deleted file mode 100644
index 5a50f69..0000000
--- a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/PdfImage.java
+++ /dev/null
@@ -1,107 +0,0 @@
-package com.github.terefang.imageutil;
-
-import de.rototor.pdfbox.graphics2d.PdfBoxGraphics2D;
-import de.rototor.pdfbox.graphics2d.PdfBoxGraphics2DFontTextDrawer;
-import lombok.SneakyThrows;
-import org.apache.pdfbox.pdmodel.PDDocument;
-import org.apache.pdfbox.pdmodel.PDPage;
-import org.apache.pdfbox.pdmodel.PDPageContentStream;
-import org.apache.pdfbox.pdmodel.common.PDRectangle;
-import org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject;
-import org.apache.pdfbox.util.Matrix;
-import org.codehaus.plexus.util.IOUtil;
-import org.jfree.graphics2d.svg.SVGGraphics2D;
-import org.jfree.graphics2d.svg.SVGHints;
-import org.jfree.graphics2d.svg.SVGUnits;
-
-import java.awt.*;
-import java.io.*;
-import java.util.UUID;
-
-public class PdfImage extends AbstractGfxInterface implements GfxInterface
-{
- PdfCustomFontTextDrawer fontTextDrawer = new PdfCustomFontTextDrawer();
- PDDocument document;
- PDPage page;
- PdfBoxGraphics2D g2d;
- public static final PdfImage create(int _width, int _height) {
- return new PdfImage(_width, _height);
- }
-
- public void registerFont(Font _font, File _file)
- {
- this.fontTextDrawer.registerFont(_font.getFontName(), _file);
- }
-
- @SneakyThrows
- public PdfImage(int width, int height)
- {
- super();
- this.document = new PDDocument();
- this.page = new PDPage(new PDRectangle(width, height));
- this.document.addPage(this.page);
- this.g2d = new PdfBoxGraphics2D(this.document, width, height);
- this.g2d.setFontTextDrawer(this.fontTextDrawer);
- }
-
- @Override
- public Graphics2D getG2d() {
- return (Graphics2D) this.g2d.create();
- }
-
- @Override
- public void gSet(int _x, int _y, long _color) {
- Graphics2D _g = this.getG2d();
- _g.setColor(ImageUtil.createColor(_color));
- _g.fillRect(_x, _y, 1, 1);
- _g.dispose();
- }
-
- public String beginGroup()
- {
- return beginGroup(UUID.randomUUID().toString());
- }
-
- public String beginGroup(String _id)
- {
- this.g2d.setRenderingHint(SVGHints.KEY_BEGIN_GROUP, _id);
- return _id;
- }
-
- public void endGroup()
- {
- this.g2d.setRenderingHint(SVGHints.KEY_END_GROUP, "true");
- }
-
- @Override
- public int gGet(int _x, int _y) {
- return 0;
- }
-
- @SneakyThrows
- public void save(String _path) {
- this.save(new File(_path));
- }
-
- @SneakyThrows
- public void save(File _out)
- {
- this.save(new FileOutputStream(_out));
- }
-
- @SneakyThrows
- public void save(OutputStream _out)
- {
- this.g2d.dispose();
- PDFormXObject xform = this.g2d.getXFormObject();
- Matrix matrix = new Matrix();
- matrix.translate(0, this.page.getMediaBox().getHeight());
- PDPageContentStream contentStream = new PDPageContentStream(this.document, this.page);
- //contentStream.transform(matrix);
- contentStream.drawForm(xform);
- contentStream.close();
-
- this.document.save(new BufferedOutputStream(_out, 8192));
- document.close();
- }
-}
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/PdfStdEncoding.java b/template-maven-plugin/src/main/java/com/github/terefang/imageutil/PdfStdEncoding.java
deleted file mode 100644
index 5421655..0000000
--- a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/PdfStdEncoding.java
+++ /dev/null
@@ -1,275 +0,0 @@
-package com.github.terefang.imageutil;
-
-import org.apache.pdfbox.cos.*;
-import org.apache.pdfbox.pdmodel.font.encoding.DictionaryEncoding;
-import org.apache.pdfbox.pdmodel.font.encoding.Encoding;
-import org.apache.pdfbox.pdmodel.font.encoding.MacRomanEncoding;
-
-public class PdfStdEncoding extends DictionaryEncoding
-{
- static COSArray DIFS = new COSArray();
- static {
- DIFS.add(COSInteger.ZERO);
- DIFS.add(COSName.getPDFName("uni0000"));
- DIFS.add(COSName.getPDFName("controlSTX"));
- DIFS.add(COSName.getPDFName("controlSOT"));
- DIFS.add(COSName.getPDFName("controlETX"));
- DIFS.add(COSName.getPDFName("controlEOT"));
- DIFS.add(COSName.getPDFName("controlENQ"));
- DIFS.add(COSName.getPDFName("controlACK"));
- DIFS.add(COSName.getPDFName("controlBEL"));
- DIFS.add(COSName.getPDFName("controlBS"));
- DIFS.add(COSName.getPDFName("controlHT"));
- DIFS.add(COSName.getPDFName("controlLF"));
- DIFS.add(COSName.getPDFName("controlVT"));
- DIFS.add(COSName.getPDFName("controlFF"));
- DIFS.add(COSName.getPDFName("controlCR"));
- DIFS.add(COSName.getPDFName("controlSO"));
- DIFS.add(COSName.getPDFName("controlSI"));
- DIFS.add(COSName.getPDFName("controlDLE"));
- DIFS.add(COSName.getPDFName("controlDC1"));
- DIFS.add(COSName.getPDFName("controlDC2"));
- DIFS.add(COSName.getPDFName("controlDC3"));
- DIFS.add(COSName.getPDFName("controlDC4"));
- DIFS.add(COSName.getPDFName("controlNAK"));
- DIFS.add(COSName.getPDFName("controlSYN"));
- DIFS.add(COSName.getPDFName("controlETB"));
- DIFS.add(COSName.getPDFName("breve"));
- DIFS.add(COSName.getPDFName("caron"));
- DIFS.add(COSName.getPDFName("circumflex"));
- DIFS.add(COSName.getPDFName("dotaccent"));
- DIFS.add(COSName.getPDFName("hungarumlaut"));
- DIFS.add(COSName.getPDFName("ogonek"));
- DIFS.add(COSName.getPDFName("ring"));
- DIFS.add(COSName.getPDFName("tilde"));
- DIFS.add(COSName.getPDFName("space"));
- DIFS.add(COSName.getPDFName("exclam"));
- DIFS.add(COSName.getPDFName("quotedbl"));
- DIFS.add(COSName.getPDFName("numbersign"));
- DIFS.add(COSName.getPDFName("dollar"));
- DIFS.add(COSName.getPDFName("percent"));
- DIFS.add(COSName.getPDFName("ampersand"));
- DIFS.add(COSName.getPDFName("quotesingle"));
- DIFS.add(COSName.getPDFName("parenleft"));
- DIFS.add(COSName.getPDFName("parenright"));
- DIFS.add(COSName.getPDFName("asterisk"));
- DIFS.add(COSName.getPDFName("plus"));
- DIFS.add(COSName.getPDFName("comma"));
- DIFS.add(COSName.getPDFName("hyphen"));
- DIFS.add(COSName.getPDFName("period"));
- DIFS.add(COSName.getPDFName("slash"));
- DIFS.add(COSName.getPDFName("zero"));
- DIFS.add(COSName.getPDFName("one"));
- DIFS.add(COSName.getPDFName("two"));
- DIFS.add(COSName.getPDFName("three"));
- DIFS.add(COSName.getPDFName("four"));
- DIFS.add(COSName.getPDFName("five"));
- DIFS.add(COSName.getPDFName("six"));
- DIFS.add(COSName.getPDFName("seven"));
- DIFS.add(COSName.getPDFName("eight"));
- DIFS.add(COSName.getPDFName("nine"));
- DIFS.add(COSName.getPDFName("colon"));
- DIFS.add(COSName.getPDFName("semicolon"));
- DIFS.add(COSName.getPDFName("less"));
- DIFS.add(COSName.getPDFName("equal"));
- DIFS.add(COSName.getPDFName("greater"));
- DIFS.add(COSName.getPDFName("question"));
- DIFS.add(COSName.getPDFName("at"));
- DIFS.add(COSName.getPDFName("A"));
- DIFS.add(COSName.getPDFName("B"));
- DIFS.add(COSName.getPDFName("C"));
- DIFS.add(COSName.getPDFName("D"));
- DIFS.add(COSName.getPDFName("E"));
- DIFS.add(COSName.getPDFName("F"));
- DIFS.add(COSName.getPDFName("G"));
- DIFS.add(COSName.getPDFName("H"));
- DIFS.add(COSName.getPDFName("I"));
- DIFS.add(COSName.getPDFName("J"));
- DIFS.add(COSName.getPDFName("K"));
- DIFS.add(COSName.getPDFName("L"));
- DIFS.add(COSName.getPDFName("M"));
- DIFS.add(COSName.getPDFName("N"));
- DIFS.add(COSName.getPDFName("O"));
- DIFS.add(COSName.getPDFName("P"));
- DIFS.add(COSName.getPDFName("Q"));
- DIFS.add(COSName.getPDFName("R"));
- DIFS.add(COSName.getPDFName("S"));
- DIFS.add(COSName.getPDFName("T"));
- DIFS.add(COSName.getPDFName("U"));
- DIFS.add(COSName.getPDFName("V"));
- DIFS.add(COSName.getPDFName("W"));
- DIFS.add(COSName.getPDFName("X"));
- DIFS.add(COSName.getPDFName("Y"));
- DIFS.add(COSName.getPDFName("Z"));
- DIFS.add(COSName.getPDFName("bracketleft"));
- DIFS.add(COSName.getPDFName("backslash"));
- DIFS.add(COSName.getPDFName("bracketright"));
- DIFS.add(COSName.getPDFName("asciicircum"));
- DIFS.add(COSName.getPDFName("underscore"));
- DIFS.add(COSName.getPDFName("grave"));
- DIFS.add(COSName.getPDFName("a"));
- DIFS.add(COSName.getPDFName("b"));
- DIFS.add(COSName.getPDFName("c"));
- DIFS.add(COSName.getPDFName("d"));
- DIFS.add(COSName.getPDFName("e"));
- DIFS.add(COSName.getPDFName("f"));
- DIFS.add(COSName.getPDFName("g"));
- DIFS.add(COSName.getPDFName("h"));
- DIFS.add(COSName.getPDFName("i"));
- DIFS.add(COSName.getPDFName("j"));
- DIFS.add(COSName.getPDFName("k"));
- DIFS.add(COSName.getPDFName("l"));
- DIFS.add(COSName.getPDFName("m"));
- DIFS.add(COSName.getPDFName("n"));
- DIFS.add(COSName.getPDFName("o"));
- DIFS.add(COSName.getPDFName("p"));
- DIFS.add(COSName.getPDFName("q"));
- DIFS.add(COSName.getPDFName("r"));
- DIFS.add(COSName.getPDFName("s"));
- DIFS.add(COSName.getPDFName("t"));
- DIFS.add(COSName.getPDFName("u"));
- DIFS.add(COSName.getPDFName("v"));
- DIFS.add(COSName.getPDFName("w"));
- DIFS.add(COSName.getPDFName("x"));
- DIFS.add(COSName.getPDFName("y"));
- DIFS.add(COSName.getPDFName("z"));
- DIFS.add(COSName.getPDFName("braceleft"));
- DIFS.add(COSName.getPDFName("bar"));
- DIFS.add(COSName.getPDFName("braceright"));
- DIFS.add(COSName.getPDFName("asciitilde"));
- DIFS.add(COSName.getPDFName("uniFFFD"));
- DIFS.add(COSName.getPDFName("bullet"));
- DIFS.add(COSName.getPDFName("dagger"));
- DIFS.add(COSName.getPDFName("daggerdbl"));
- DIFS.add(COSName.getPDFName("ellipsis"));
- DIFS.add(COSName.getPDFName("emdash"));
- DIFS.add(COSName.getPDFName("endash"));
- DIFS.add(COSName.getPDFName("florin"));
- DIFS.add(COSName.getPDFName("fraction"));
- DIFS.add(COSName.getPDFName("guilsinglleft"));
- DIFS.add(COSName.getPDFName("guilsinglright"));
- DIFS.add(COSName.getPDFName("minus"));
- DIFS.add(COSName.getPDFName("perthousand"));
- DIFS.add(COSName.getPDFName("quotedblbase"));
- DIFS.add(COSName.getPDFName("quotedblleft"));
- DIFS.add(COSName.getPDFName("quotedblright"));
- DIFS.add(COSName.getPDFName("quoteleft"));
- DIFS.add(COSName.getPDFName("quoteright"));
- DIFS.add(COSName.getPDFName("quotesinglbase"));
- DIFS.add(COSName.getPDFName("trademark"));
- DIFS.add(COSName.getPDFName("uniFB01"));
- DIFS.add(COSName.getPDFName("uniFB02"));
- DIFS.add(COSName.getPDFName("Lslash"));
- DIFS.add(COSName.getPDFName("OE"));
- DIFS.add(COSName.getPDFName("Scaron"));
- DIFS.add(COSName.getPDFName("Ydieresis"));
- DIFS.add(COSName.getPDFName("Zcaron"));
- DIFS.add(COSName.getPDFName("dotlessi"));
- DIFS.add(COSName.getPDFName("lslash"));
- DIFS.add(COSName.getPDFName("oe"));
- DIFS.add(COSName.getPDFName("scaron"));
- DIFS.add(COSName.getPDFName("zcaron"));
- DIFS.add(COSName.getPDFName("uniFFFD"));
- DIFS.add(COSName.getPDFName("Euro"));
- DIFS.add(COSName.getPDFName("exclamdown"));
- DIFS.add(COSName.getPDFName("cent"));
- DIFS.add(COSName.getPDFName("sterling"));
- DIFS.add(COSName.getPDFName("currency"));
- DIFS.add(COSName.getPDFName("yen"));
- DIFS.add(COSName.getPDFName("brokenbar"));
- DIFS.add(COSName.getPDFName("section"));
- DIFS.add(COSName.getPDFName("dieresis"));
- DIFS.add(COSName.getPDFName("copyright"));
- DIFS.add(COSName.getPDFName("ordfeminine"));
- DIFS.add(COSName.getPDFName("guillemotleft"));
- DIFS.add(COSName.getPDFName("logicalnot"));
- DIFS.add(COSName.getPDFName("uni00AD"));
- DIFS.add(COSName.getPDFName("registered"));
- DIFS.add(COSName.getPDFName("macron"));
- DIFS.add(COSName.getPDFName("degree"));
- DIFS.add(COSName.getPDFName("plusminus"));
- DIFS.add(COSName.getPDFName("uni00B2"));
- DIFS.add(COSName.getPDFName("uni00B3"));
- DIFS.add(COSName.getPDFName("acute"));
- DIFS.add(COSName.getPDFName("mu"));
- DIFS.add(COSName.getPDFName("paragraph"));
- DIFS.add(COSName.getPDFName("periodcentered"));
- DIFS.add(COSName.getPDFName("cedilla"));
- DIFS.add(COSName.getPDFName("uni00B9"));
- DIFS.add(COSName.getPDFName("ordmasculine"));
- DIFS.add(COSName.getPDFName("guillemotright"));
- DIFS.add(COSName.getPDFName("onequarter"));
- DIFS.add(COSName.getPDFName("onehalf"));
- DIFS.add(COSName.getPDFName("threequarters"));
- DIFS.add(COSName.getPDFName("questiondown"));
- DIFS.add(COSName.getPDFName("Agrave"));
- DIFS.add(COSName.getPDFName("Aacute"));
- DIFS.add(COSName.getPDFName("Acircumflex"));
- DIFS.add(COSName.getPDFName("Atilde"));
- DIFS.add(COSName.getPDFName("Adieresis"));
- DIFS.add(COSName.getPDFName("Aring"));
- DIFS.add(COSName.getPDFName("AE"));
- DIFS.add(COSName.getPDFName("Ccedilla"));
- DIFS.add(COSName.getPDFName("Egrave"));
- DIFS.add(COSName.getPDFName("Eacute"));
- DIFS.add(COSName.getPDFName("Ecircumflex"));
- DIFS.add(COSName.getPDFName("Edieresis"));
- DIFS.add(COSName.getPDFName("Igrave"));
- DIFS.add(COSName.getPDFName("Iacute"));
- DIFS.add(COSName.getPDFName("Icircumflex"));
- DIFS.add(COSName.getPDFName("Idieresis"));
- DIFS.add(COSName.getPDFName("Eth"));
- DIFS.add(COSName.getPDFName("Ntilde"));
- DIFS.add(COSName.getPDFName("Ograve"));
- DIFS.add(COSName.getPDFName("Oacute"));
- DIFS.add(COSName.getPDFName("Ocircumflex"));
- DIFS.add(COSName.getPDFName("Otilde"));
- DIFS.add(COSName.getPDFName("Odieresis"));
- DIFS.add(COSName.getPDFName("multiply"));
- DIFS.add(COSName.getPDFName("Oslash"));
- DIFS.add(COSName.getPDFName("Ugrave"));
- DIFS.add(COSName.getPDFName("Uacute"));
- DIFS.add(COSName.getPDFName("Ucircumflex"));
- DIFS.add(COSName.getPDFName("Udieresis"));
- DIFS.add(COSName.getPDFName("Yacute"));
- DIFS.add(COSName.getPDFName("Thorn"));
- DIFS.add(COSName.getPDFName("germandbls"));
- DIFS.add(COSName.getPDFName("agrave"));
- DIFS.add(COSName.getPDFName("aacute"));
- DIFS.add(COSName.getPDFName("acircumflex"));
- DIFS.add(COSName.getPDFName("atilde"));
- DIFS.add(COSName.getPDFName("adieresis"));
- DIFS.add(COSName.getPDFName("aring"));
- DIFS.add(COSName.getPDFName("ae"));
- DIFS.add(COSName.getPDFName("ccedilla"));
- DIFS.add(COSName.getPDFName("egrave"));
- DIFS.add(COSName.getPDFName("eacute"));
- DIFS.add(COSName.getPDFName("ecircumflex"));
- DIFS.add(COSName.getPDFName("edieresis"));
- DIFS.add(COSName.getPDFName("igrave"));
- DIFS.add(COSName.getPDFName("iacute"));
- DIFS.add(COSName.getPDFName("icircumflex"));
- DIFS.add(COSName.getPDFName("idieresis"));
- DIFS.add(COSName.getPDFName("eth"));
- DIFS.add(COSName.getPDFName("ntilde"));
- DIFS.add(COSName.getPDFName("ograve"));
- DIFS.add(COSName.getPDFName("oacute"));
- DIFS.add(COSName.getPDFName("ocircumflex"));
- DIFS.add(COSName.getPDFName("otilde"));
- DIFS.add(COSName.getPDFName("odieresis"));
- DIFS.add(COSName.getPDFName("divide"));
- DIFS.add(COSName.getPDFName("oslash"));
- DIFS.add(COSName.getPDFName("ugrave"));
- DIFS.add(COSName.getPDFName("uacute"));
- DIFS.add(COSName.getPDFName("ucircumflex"));
- DIFS.add(COSName.getPDFName("udieresis"));
- DIFS.add(COSName.getPDFName("yacute"));
- DIFS.add(COSName.getPDFName("thorn"));
- DIFS.add(COSName.getPDFName("ydieresis"));
- }
-
- public PdfStdEncoding()
- {
- super(COSName.WIN_ANSI_ENCODING, DIFS);
- }
-}
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/PixelImage.java b/template-maven-plugin/src/main/java/com/github/terefang/imageutil/PixelImage.java
deleted file mode 100644
index f48c483..0000000
--- a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/PixelImage.java
+++ /dev/null
@@ -1,114 +0,0 @@
-package com.github.terefang.imageutil;
-
-import lombok.SneakyThrows;
-
-import java.awt.*;
-import java.awt.image.BufferedImage;
-import java.io.File;
-import java.io.OutputStream;
-import java.util.Iterator;
-import javax.imageio.ImageIO;
-import javax.imageio.ImageReadParam;
-import javax.imageio.ImageReader;
-import javax.imageio.stream.ImageInputStream;
-
-public class PixelImage extends AbstractGfxInterface implements GfxInterface {
-
- BufferedImage _bimg;
-
- public static final PixelImage create(int _width, int _height) {
- return new PixelImage(_width, _height);
- }
-
- public static final PixelImage from(BufferedImage _bimg) {
- PixelImage _pi = new PixelImage(_bimg.getWidth(), _bimg.getHeight());
- _bimg.copyData(_pi._bimg.getRaster());
- return _pi;
- }
-
- public PixelImage(int _width, int _height) {
- _bimg = new BufferedImage(_width, _height, BufferedImage.TYPE_INT_ARGB);
- }
-
- @SneakyThrows
- public void savePng(String _path) {
- this.saveAs("png", new File(_path));
- }
-
- @SneakyThrows
- public void savePng(File _out) {
- this.saveAs("png", _out);
- }
-
- @SneakyThrows
- public void savePng(OutputStream _out) {
- this.saveAs("png", _out);
- }
-
- @SneakyThrows
- public void saveAs(String _type, File _out) {
- ImageIO.write(this._bimg, _type, _out);
- }
-
- @SneakyThrows
- public void saveAs(String _type, OutputStream _out) {
- ImageIO.write(this._bimg, _type, _out);
- }
-
- @SneakyThrows
- public void save(File _out) { this.saveAs("png", _out);}
-
- @SneakyThrows
- public void save(OutputStream _out) { this.saveAs("png", _out);}
-
- @SneakyThrows
- public static PixelImage load(File _file) {
- ImageInputStream stream = ImageIO.createImageInputStream(_file);
- Iterator readers = ImageIO.getImageReaders(stream);
-
- if (readers.hasNext()) {
- ImageReader reader = readers.next();
- reader.setInput(reader);
-
- int w = reader.getWidth(0);
- int h = reader.getHeight(0);
-
- ImageReadParam param = reader.getDefaultReadParam();
-
- PixelImage _pi = PixelImage.create(w, h);
- param.setDestination(_pi._bimg);
-
- reader.read(0, param);
- return _pi;
- }
- return null;
- }
-
- @Override
- public Graphics2D getG2d() {
- return (Graphics2D) this._bimg.getGraphics();
- }
-
- @Override
- public String beginGroup() {
- return null;
- }
-
- @Override
- public String beginGroup(String _id) {
- return null;
- }
-
- @Override
- public void endGroup() {
-
- }
-
- public int gGet(int _x, int _y) { return this._bimg.getRGB(_x, _y); }
-
- public void gSet(int _x, int _y, long _color) { this._bimg.setRGB(_x, _y, (int)_color); }
-
- public int gColorReplace(int _src, int _dst) { return 0; }
- public int gColorReplaceThreshold(int _src, int _dst, float _threshold) { return 0; }
-
-}
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/StackedGfxInterface.java b/template-maven-plugin/src/main/java/com/github/terefang/imageutil/StackedGfxInterface.java
deleted file mode 100644
index 3d8be8e..0000000
--- a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/StackedGfxInterface.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package com.github.terefang.imageutil;
-
-import java.awt.*;
-
-public interface StackedGfxInterface
-{
- public Graphics2D getCurrentGraphics2D();
-
- public void beginDraw();
- public void beginDraw(String _id);
- public void endDraw();
- public void beginText();
- public void endText();
-
- public void draw3DRect(int x, int y, int width, int height, boolean raised);
-
- public void fill3DRect(int x, int y, int width, int height, boolean raised);
-
- public void drawString(String str, int x, int y);
-
- public void drawString(String str, float x, float y);
-
- public void setComposite(Composite comp);
-
- public void setPaint(Paint paint);
-
- public void setStroke(Stroke s);
-
- public void translate(int x, int y);
-
- public void translate(double tx, double ty);
-
- public void rotate(double theta);
-
- public void rotate(double theta, double x, double y);
-
- public void scale(double sx, double sy);
-
- public void shear(double shx, double shy);
-
- public void setBackground(int _color);
-
- public void clip(Shape s);
-
- default void clip(int[] _points)
- {
- Polygon _p = new Polygon();
- for(int _i = 0; _i<_points.length; _i+=2)
- {
- _p.addPoint(_points[_i], _points[_i+1]);
- }
- clip(_p);
- }
-
- public void setColor(long _color);
-
- public void setPaintMode();
-
- public void setFont(Font font);
-
- public void clipRect(int x, int y, int width, int height);
-
- public void setClip(int x, int y, int width, int height);
-
- public void drawLine(int x1, int y1, int x2, int y2);
-
- public void fillRect(int x, int y, int width, int height);
-
- public void drawRect(int x, int y, int width, int height);
-
- public void clearRect(int x, int y, int width, int height);
-
- public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight);
-
- public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight);
-
- public void drawOval(int x, int y, int width, int height);
-
- public void fillOval(int x, int y, int width, int height);
-
- public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle);
-
- public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle);
-
- public void drawPolyline(int[] points);
-
- public void drawPolygon(int[] points);
-
- public void fillPolygon(int[] points);
-
- public void dispose();
-}
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/SvgImage.java b/template-maven-plugin/src/main/java/com/github/terefang/imageutil/SvgImage.java
deleted file mode 100644
index ac6ec0d..0000000
--- a/template-maven-plugin/src/main/java/com/github/terefang/imageutil/SvgImage.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package com.github.terefang.imageutil;
-
-import lombok.SneakyThrows;
-import org.apache.commons.io.IOUtils;
-import org.codehaus.plexus.util.IOUtil;
-import org.jfree.graphics2d.svg.SVGGraphics2D;
-import org.jfree.graphics2d.svg.SVGHints;
-import org.jfree.graphics2d.svg.SVGUnits;
-
-import java.awt.*;
-import java.io.*;
-import java.util.UUID;
-
-public class SvgImage extends AbstractGfxInterface implements GfxInterface
-{
- SVGGraphics2D g2d;
- public static final SvgImage create(int _width, int _height) {
- return new SvgImage(_width, _height);
- }
-
- public SvgImage(int width, int height)
- {
- super();
- this.g2d = new SVGGraphics2D(width, height);
- this.g2d.setFontSizeUnits(SVGUnits.PT);
- }
-
- @Override
- public Graphics2D getG2d() {
- return (Graphics2D) this.g2d.create();
- }
-
- @Override
- public void gSet(int _x, int _y, long _color) {
- Graphics2D _g = this.getG2d();
- _g.setColor(ImageUtil.createColor(_color));
- _g.fillRect(_x, _y, 1, 1);
- _g.dispose();
- }
-
- public String beginGroup()
- {
- return beginGroup(UUID.randomUUID().toString());
- }
-
- public String beginGroup(String _id)
- {
- this.g2d.setRenderingHint(SVGHints.KEY_BEGIN_GROUP, _id);
- return _id;
- }
-
- public void endGroup()
- {
- this.g2d.setRenderingHint(SVGHints.KEY_END_GROUP, "true");
- }
-
- @Override
- public int gGet(int _x, int _y) {
- return 0;
- }
-
- @SneakyThrows
- public void save(String _path) {
- this.save(new File(_path));
- }
-
- @SneakyThrows
- public void save(File _out)
- {
- this.save(new FileOutputStream(_out));
- }
-
- @SneakyThrows
- public void save(OutputStream _out)
- {
- BufferedWriter _bw = new BufferedWriter(new OutputStreamWriter(_out), 8192);
- IOUtil.copy(this.g2d.getSVGDocument(), _bw);
- IOUtil.close(_bw);
- }
-}
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/AbstractTmpMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/AbstractTmpMojo.java
index 474d7d4..3b09c63 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/AbstractTmpMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/AbstractTmpMojo.java
@@ -1,8 +1,8 @@
package com.github.terefang.template_maven_plugin;
-import com.github.terefang.imageutil.GfxInterface;
-import com.github.terefang.imageutil.PixelImage;
-import com.github.terefang.imageutil.SvgImage;
+import com.github.terefang.jmelange.image.GfxInterface;
+import com.github.terefang.jmelange.image.PixelImage;
+import com.github.terefang.jmelange.image.SvgImage;
import com.github.terefang.template_maven_plugin.util.ContextHelper;
import com.github.terefang.template_maven_plugin.util.ContextUtil;
import lombok.Data;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/freemarker/FreeMarkerStandardMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/freemarker/FreeMarkerStandardMojo.java
index e52a011..42a2c06 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/freemarker/FreeMarkerStandardMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/freemarker/FreeMarkerStandardMojo.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.freemarker;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractStandardMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import lombok.SneakyThrows;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/freemarker/FreeMarkerTemplateMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/freemarker/FreeMarkerTemplateMojo.java
index 0e9854d..c99d857 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/freemarker/FreeMarkerTemplateMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/freemarker/FreeMarkerTemplateMojo.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.freemarker;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractTemplateMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import lombok.SneakyThrows;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/groovy/GSimpleStandardMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/groovy/GSimpleStandardMojo.java
index 2a93b00..b856228 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/groovy/GSimpleStandardMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/groovy/GSimpleStandardMojo.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.groovy;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractStandardMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import lombok.SneakyThrows;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/groovy/GSimpleTemplateMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/groovy/GSimpleTemplateMojo.java
index 8e8e139..6870ea7 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/groovy/GSimpleTemplateMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/groovy/GSimpleTemplateMojo.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.groovy;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractTemplateMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import com.github.terefang.template_maven_plugin.thymeleaf.ThymeleafUtil;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/groovy/GroovyStandardMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/groovy/GroovyStandardMojo.java
index 00747ae..2455413 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/groovy/GroovyStandardMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/groovy/GroovyStandardMojo.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.groovy;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractStandardMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import lombok.Data;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/groovy/GroovyTemplateMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/groovy/GroovyTemplateMojo.java
index 4e7bd73..bc0a868 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/groovy/GroovyTemplateMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/groovy/GroovyTemplateMojo.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.groovy;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractTemplateMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import lombok.Data;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/groovy/GroovyUtil.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/groovy/GroovyUtil.java
index 8dc692a..f90ce37 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/groovy/GroovyUtil.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/groovy/GroovyUtil.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.groovy;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.TemplateContext;
import groovy.lang.Binding;
import groovy.lang.Closure;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/handlebars/HandlebarsStandardMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/handlebars/HandlebarsStandardMojo.java
index 96d71f9..47fad0d 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/handlebars/HandlebarsStandardMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/handlebars/HandlebarsStandardMojo.java
@@ -1,7 +1,7 @@
package com.github.terefang.template_maven_plugin.handlebars;
import com.github.jknack.handlebars.Handlebars;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractStandardMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import lombok.SneakyThrows;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/handlebars/HandlebarsTemplateMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/handlebars/HandlebarsTemplateMojo.java
index d90593c..419efcf 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/handlebars/HandlebarsTemplateMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/handlebars/HandlebarsTemplateMojo.java
@@ -1,7 +1,7 @@
package com.github.terefang.template_maven_plugin.handlebars;
import com.github.jknack.handlebars.Handlebars;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractTemplateMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import lombok.SneakyThrows;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jexl/JexlJxtStandardMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jexl/JexlJxtStandardMojo.java
index 88c726c..c6d9db5 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jexl/JexlJxtStandardMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jexl/JexlJxtStandardMojo.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.jexl;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractStandardMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import lombok.SneakyThrows;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jexl/JexlJxtTemplateMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jexl/JexlJxtTemplateMojo.java
index 4459f24..b8d8b41 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jexl/JexlJxtTemplateMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jexl/JexlJxtTemplateMojo.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.jexl;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractTemplateMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import freemarker.log._CommonsLoggingLoggerFactory;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jexl/JexlStandardMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jexl/JexlStandardMojo.java
index 252c70a..60f5ddd 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jexl/JexlStandardMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jexl/JexlStandardMojo.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.jexl;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractStandardMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import lombok.SneakyThrows;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jexl/JexlTemplateMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jexl/JexlTemplateMojo.java
index 58ccb2e..6169de1 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jexl/JexlTemplateMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jexl/JexlTemplateMojo.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.jexl;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractTemplateMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import lombok.SneakyThrows;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jexl/JexlUtil.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jexl/JexlUtil.java
index 8c8534f..0091705 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jexl/JexlUtil.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jexl/JexlUtil.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.jexl;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.TemplateContext;
import lombok.SneakyThrows;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jinjava/JinjavaStandardMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jinjava/JinjavaStandardMojo.java
index af2aadc..6f901ce 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jinjava/JinjavaStandardMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jinjava/JinjavaStandardMojo.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.jinjava;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractStandardMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import com.hubspot.jinjava.Jinjava;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jinjava/JinjavaTemplateMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jinjava/JinjavaTemplateMojo.java
index 4bfe6bf..281080b 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jinjava/JinjavaTemplateMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/jinjava/JinjavaTemplateMojo.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.jinjava;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractTemplateMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import com.github.terefang.template_maven_plugin.util.ContextUtil;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/luaj/LuajStandardMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/luaj/LuajStandardMojo.java
index 4c8e38b..c00e241 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/luaj/LuajStandardMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/luaj/LuajStandardMojo.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.luaj;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractStandardMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import lombok.Data;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/luaj/LuajTemplateMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/luaj/LuajTemplateMojo.java
index 813c71f..7758467 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/luaj/LuajTemplateMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/luaj/LuajTemplateMojo.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.luaj;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractTemplateMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import lombok.Data;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/rhino/RhinoScript.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/rhino/RhinoScript.java
index de935ff..f4b9583 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/rhino/RhinoScript.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/rhino/RhinoScript.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.rhino;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.TemplateContext;
import lombok.Data;
import lombok.SneakyThrows;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/rhino/RhinoStandardMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/rhino/RhinoStandardMojo.java
index 9133242..fcdbdbd 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/rhino/RhinoStandardMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/rhino/RhinoStandardMojo.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.rhino;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractStandardMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import lombok.Data;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/rhino/RhinoTemplateMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/rhino/RhinoTemplateMojo.java
index 51335eb..109612a 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/rhino/RhinoTemplateMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/rhino/RhinoTemplateMojo.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.rhino;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractTemplateMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import lombok.Data;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/thymeleaf/ThymeleafStandardMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/thymeleaf/ThymeleafStandardMojo.java
index e96a852..2aa1355 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/thymeleaf/ThymeleafStandardMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/thymeleaf/ThymeleafStandardMojo.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.thymeleaf;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractStandardMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import lombok.SneakyThrows;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/thymeleaf/ThymeleafTemplateMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/thymeleaf/ThymeleafTemplateMojo.java
index f8a8503..8f4b811 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/thymeleaf/ThymeleafTemplateMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/thymeleaf/ThymeleafTemplateMojo.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.thymeleaf;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractTemplateMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import lombok.SneakyThrows;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/trimou/TrimouStandardMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/trimou/TrimouStandardMojo.java
index cc21454..8fe5864 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/trimou/TrimouStandardMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/trimou/TrimouStandardMojo.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.trimou;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractStandardMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import com.hubspot.jinjava.Jinjava;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/trimou/TrimouTemplateMojo.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/trimou/TrimouTemplateMojo.java
index 2ec5359..015d2d7 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/trimou/TrimouTemplateMojo.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/trimou/TrimouTemplateMojo.java
@@ -1,6 +1,6 @@
package com.github.terefang.template_maven_plugin.trimou;
-import com.github.terefang.imageutil.GfxInterface;
+import com.github.terefang.jmelange.image.GfxInterface;
import com.github.terefang.template_maven_plugin.AbstractTemplateMojo;
import com.github.terefang.template_maven_plugin.TemplateContext;
import com.hubspot.jinjava.Jinjava;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/util/ContextHelper.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/util/ContextHelper.java
index 0899586..19b8554 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/util/ContextHelper.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/util/ContextHelper.java
@@ -1,8 +1,8 @@
package com.github.terefang.template_maven_plugin.util;
-import com.github.terefang.imageutil.PdfImage;
-import com.github.terefang.imageutil.PixelImage;
-import com.github.terefang.imageutil.SvgImage;
+import com.github.terefang.jmelange.image.PdfImage;
+import com.github.terefang.jmelange.image.PixelImage;
+import com.github.terefang.jmelange.image.SvgImage;
import com.github.terefang.jdao.JDAO;
import com.github.terefang.template_maven_plugin.TemplateContext;
import lombok.SneakyThrows;
diff --git a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/util/ContextUtil.java b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/util/ContextUtil.java
index 7801e9c..ef188de 100644
--- a/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/util/ContextUtil.java
+++ b/template-maven-plugin/src/main/java/com/github/terefang/template_maven_plugin/util/ContextUtil.java
@@ -1,10 +1,12 @@
package com.github.terefang.template_maven_plugin.util;
-import com.github.terefang.imageutil.PdfImage;
-import com.github.terefang.imageutil.PixelImage;
-import com.github.terefang.imageutil.SvgImage;
+import com.github.terefang.jmelange.image.PdfImage;
+import com.github.terefang.jmelange.image.PixelImage;
+import com.github.terefang.jmelange.image.SvgImage;
import com.github.terefang.jdao.JDAO;
import com.github.terefang.jdao.JdaoUtils;
+import com.github.terefang.jmelange.pdata.PdataParser;
+import com.github.terefang.jmelange.pdata.PdataWriter;
import com.github.terefang.template_maven_plugin.luaj.LuaScriptContext;
import com.moandjiezana.toml.Toml;
import lombok.SneakyThrows;
@@ -422,7 +424,7 @@ public static List