diff --git a/.classpath b/.classpath
index 46ec0e4..41e1dcf 100644
--- a/.classpath
+++ b/.classpath
@@ -1,37 +1,29 @@
-
-
-
+
+
+
+
+
+
+
+
-
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
diff --git a/.project b/.project
index 0c4903f..9489f23 100644
--- a/.project
+++ b/.project
@@ -1,35 +1,28 @@
- atriasoft-esvg
+ esvg
- atriasoft-esvg
+
+ org.python.pydev.PyDevBuilder
+
+
+
org.eclipse.jdt.core.javabuilder
- net.sf.eclipsecs.core.CheckstyleBuilder
+ org.eclipse.m2e.core.maven2Builder
org.eclipse.jdt.core.javanature
- net.sf.eclipsecs.core.CheckstyleNature
+ org.eclipse.m2e.core.maven2Nature
-
-
- 1646149232192
-
- 30
-
- org.eclipse.core.resources.regexFilterMatcher
- node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__
-
-
-
diff --git a/esvg.iml b/esvg.iml
deleted file mode 100644
index c90834f..0000000
--- a/esvg.iml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/lutin_org-atriasoft-esvg.py b/lutin_org-atriasoft-esvg.py
index 58492b6..251f1f6 100644
--- a/lutin_org-atriasoft-esvg.py
+++ b/lutin_org-atriasoft-esvg.py
@@ -38,7 +38,7 @@ def configure(target, my_module):
'src/org/atriasoft/esvg/Base.java',
'src/org/atriasoft/esvg/Text.java',
'src/org/atriasoft/esvg/RadialGradient.java',
- 'src/org/atriasoft/esvg/internal/Log.java',
+ 'src/org/atriasoft/esvg/internal/LOGGER.java',
'src/org/atriasoft/esvg/font/Kerning.java',
'src/org/atriasoft/esvg/font/Glyph.java',
'src/org/atriasoft/esvg/Renderer.java',
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..754c59e
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,144 @@
+
+ 4.0.0
+ org.atriasoft
+ esvg
+ 0.1.0
+
+ 3.13.0
+ 21
+ 21
+ 3.1.1
+
+
+
+
+ gitea
+ https://gitea.atria-soft.org/api/packages/org.atriasoft/maven
+
+
+
+
+ gitea
+ https://gitea.atria-soft.org/api/packages/org.atriasoft/maven
+
+
+ gitea
+ https://gitea.atria-soft.org/api/packages/org.atriasoft/maven
+
+
+
+
+
+ org.atriasoft
+ exml
+ 0.1.0
+
+
+ org.atriasoft
+ png-encoder
+ 0.1.0
+
+
+ org.atriasoft
+ egami
+ 0.1.0
+
+
+ org.junit.jupiter
+ junit-jupiter-api
+ 5.11.0-M2
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
+ 5.11.0-M2
+ test
+
+
+ org.slf4j
+ slf4j-simple
+ 2.0.7
+ test
+
+
+
+
+ src
+
+
+ ${basedir}/resources
+
+
+ test/src
+ ${project.basedir}/out/maven/
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ ${maven.compiler.version}
+
+ ${maven.compiler.source}
+ ${maven.compiler.target}
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+
+
+ attach-sources
+
+ jar
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 3.0.0-M5
+
+
+ maven-assembly-plugin
+
+
+
+ fully.qualified.MainClass
+
+
+
+ jar-with-dependencies
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.2.0
+
+ private
+ true
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.2.0
+
+ public
+
+
+
+
+
+
diff --git a/src/module-info.java b/src/module-info.java
index 58111ef..f70c763 100644
--- a/src/module-info.java
+++ b/src/module-info.java
@@ -6,8 +6,7 @@ open module org.atriasoft.esvg {
exports org.atriasoft.esvg;
exports org.atriasoft.esvg.font;
exports org.atriasoft.esvg.render;
-
- requires transitive org.atriasoft.reggol;
+
requires transitive org.atriasoft.etk;
requires transitive org.atriasoft.exml;
requires org.atriasoft.pngencoder;
diff --git a/src/org/atriasoft/esvg/Base.java b/src/org/atriasoft/esvg/Base.java
index 9790d99..6c12123 100644
--- a/src/org/atriasoft/esvg/Base.java
+++ b/src/org/atriasoft/esvg/Base.java
@@ -2,7 +2,6 @@ package org.atriasoft.esvg;
import java.util.List;
-import org.atriasoft.esvg.internal.Log;
import org.atriasoft.etk.Color;
import org.atriasoft.etk.Distance;
import org.atriasoft.etk.math.FMath;
@@ -11,6 +10,8 @@ import org.atriasoft.etk.math.Vector2f;
import org.atriasoft.etk.util.Dynamic;
import org.atriasoft.etk.util.Pair;
import org.atriasoft.exml.model.XmlElement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/** @file
* @author Edouard DUPIN
@@ -19,6 +20,7 @@ import org.atriasoft.exml.model.XmlElement;
*/
public class Base {
+ static final Logger LOGGER = LoggerFactory.getLogger(Base.class);
public static float kappa90 = 0.5522847493f; //!< proportional lenght to the radius of a bezier handle for 90° arcs.
@@ -30,7 +32,7 @@ public class Base {
}
posStart += base.length();
if (value.length() < posStart + 2) {
- Log.error("Not enought spece in the String to have transform value for ' (' or '()' in '" + value + "'");
+ LOGGER.error("Not enought spece in the String to have transform value for ' (' or '()' in '" + value + "'");
return "";
}
if (value.charAt(posStart) == '(') {
@@ -39,19 +41,19 @@ public class Base {
} else if (value.charAt(posStart) == ' ' && value.charAt(posStart + 1) == '(') {
posStart += 2;
} else {
- Log.error("Can not indexOf ' (' or '(' in '" + value.substring(posStart) + "' for '" + value + "'");
+ LOGGER.error("Can not indexOf ' (' or '(' in '" + value.substring(posStart) + "' for '" + value + "'");
return "";
}
if (value.length() < posStart + 1) {
- Log.error("Not enought spece in the String to have transform value for ')' in '" + value + "'");
+ LOGGER.error("Not enought spece in the String to have transform value for ')' in '" + value + "'");
return "";
}
- int posEnd = value.indexOf(')', posStart);
+ final int posEnd = value.indexOf(')', posStart);
if (posEnd == -1) {
- Log.error("Missing element ')' in '" + value + "' for " + base);
+ LOGGER.error("Missing element ')' in '" + value + "' for " + base);
return "";
}
- Log.verbose("indexOf : '" + value.substring(posStart, posEnd) + "' for " + base);
+ LOGGER.trace("indexOf : '" + value.substring(posStart, posEnd) + "' for " + base);
return value.substring(posStart, posEnd);
}
@@ -83,10 +85,14 @@ public class Base {
* @param level Level of the tree
*/
void draw(final Renderer myRenderer, final Matrix2x3f basicTrans, final int level) {
- Log.warning(spacingDist(level) + "DRAW esvg::Base ... ==> No drawing availlable");
+ LOGGER.warn(spacingDist(level) + "DRAW esvg::Base ... ==> No drawing availlable");
}
- public void drawShapePoints(final List> out, final int recurtionMax, final float threshold, final Matrix2x3f basicTrans) {
+ public void drawShapePoints(
+ final List> out,
+ final int recurtionMax,
+ final float threshold,
+ final Matrix2x3f basicTrans) {
drawShapePoints(out, recurtionMax, threshold, basicTrans, 1);
}
@@ -95,10 +101,15 @@ public class Base {
* @param out where the lines are added
* @param recurtionMax interpolation recurtion max
* @param threshold threshold to stop recurtion
- * @param basicTrans Parant transformation of the environement
+ * @param basicTrans Parant transformation of the environement
* @param level Level of the tree
*/
- void drawShapePoints(final List> out, final int recurtionMax, final float threshold, final Matrix2x3f basicTrans, final int level) {
+ void drawShapePoints(
+ final List> out,
+ final int recurtionMax,
+ final float threshold,
+ final Matrix2x3f basicTrans,
+ final int level) {
}
@@ -117,22 +128,24 @@ public class Base {
*/
Pair parseColor(final String inputData) {
Pair localColor = new Pair<>(Color.WHITE, "");
- if (inputData.length() > 4 && inputData.charAt(0) == 'u' && inputData.charAt(1) == 'r' && inputData.charAt(2) == 'l' && inputData.charAt(3) == '(') {
+ if (inputData.length() > 4 && inputData.charAt(0) == 'u' && inputData.charAt(1) == 'r'
+ && inputData.charAt(2) == 'l' && inputData.charAt(3) == '(') {
if (inputData.charAt(4) == '#') {
- String color = inputData.substring(5, inputData.length() - 1);
+ final String color = inputData.substring(5, inputData.length() - 1);
localColor = new Pair<>(Color.NONE, color);
} else {
- Log.error("Problem in parsing the color : '" + inputData + "' == > url(XXX) is not supported now ...");
+ LOGGER.error(
+ "Problem in parsing the color : '" + inputData + "' == > url(XXX) is not supported now ...");
}
} else {
try {
localColor = new Pair<>(Color.valueOf256(inputData), "");
- } catch (Exception e) {
+ } catch (final Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
- Log.verbose("Parse color : \"" + inputData + "\" == > " + localColor.first + " " + localColor.second);
+ LOGGER.trace("Parse color : \"" + inputData + "\" == > " + localColor.first + " " + localColor.second);
return localColor;
}
@@ -142,31 +155,21 @@ public class Base {
* @return standard number of pixels
*/
float parseLength(final String dataInput) {
- Pair value = parseLength2(dataInput);
- Log.verbose(" lenght : '" + value.first + "' => unit=" + value.second);
- float fontsize = 20.0f;
- switch (value.second) {
- case POURCENT:
- return value.first;// / 100.0 * this.paint.viewPort.x();
- case ELEMENT:
- return value.first * fontsize;
- case EX:
- return value.first / 2.0f * fontsize;
- case PIXEL:
- return value.first;
- case POINT:
- return value.first * 1.25f;
- case PC:
- return value.first * 15.0f;
- case MILLIMETER:
- return value.first * 3.543307f;
- case CENTIMETER:
- return value.first * 35.43307f;
- case INCH:
- return value.first * 90.0f;
- default:
- return 0.0f;
- }
+ final Pair value = parseLength2(dataInput);
+ LOGGER.trace(" lenght : '" + value.first + "' => unit=" + value.second);
+ final float fontsize = 20.0f;
+ return switch (value.second) {
+ case POURCENT -> value.first; // / 100.0 * this.paint.viewPort.x();
+ case ELEMENT -> value.first * fontsize;
+ case EX -> value.first / 2.0f * fontsize;
+ case PIXEL -> value.first;
+ case POINT -> value.first * 1.25f;
+ case PC -> value.first * 15.0f;
+ case MILLIMETER -> value.first * 3.543307f;
+ case CENTIMETER -> value.first * 35.43307f;
+ case INCH -> value.first * 90.0f;
+ default -> 0.0f;
+ };
}
Pair parseLength2(String config) {
@@ -235,7 +238,7 @@ public class Base {
} else {
if (content.length() != 0) {
this.paint.stroke = parseColor(content);
- Log.error("Parse color : " + this.paint.stroke);
+ LOGGER.error("Parse color : " + this.paint.stroke);
}
content = element.getAttribute("stroke-width", "");
if (content.length() != 0) {
@@ -253,7 +256,7 @@ public class Base {
if (content.equals("none")) {
// OK, Nothing to do ...
} else {
- Log.todo(" 'stroke-dasharray' not implemented ...");
+ LOGGER.info("TODO 'stroke-dasharray' not implemented ...");
}
}
content = element.getAttribute("stroke-linecap", "");
@@ -266,7 +269,7 @@ public class Base {
this.paint.lineCap = CapMode.SQUARE;
} else {
this.paint.lineCap = CapMode.BUTT;
- Log.error("not know stroke-linecap value : '" + content + "', not in [butt,round,square]");
+ LOGGER.error("not know stroke-linecap value : '" + content + "', not in [butt,round,square]");
}
}
content = element.getAttribute("stroke-linejoin", "");
@@ -279,12 +282,12 @@ public class Base {
this.paint.lineJoin = JoinMode.BEVEL;
} else {
this.paint.lineJoin = JoinMode.MITER;
- Log.error("not know stroke-linejoin value : '" + content + "', not in [miter,round,bevel]");
+ LOGGER.error("not know stroke-linejoin value : '" + content + "', not in [miter,round,bevel]");
}
}
content = element.getAttribute("stroke-miterlimit", "");
if (content.length() != 0) {
- float tmp = parseLength(content);
+ final float tmp = parseLength(content);
this.paint.miterLimit = FMath.max(0.0f, tmp);
}
}
@@ -309,7 +312,7 @@ public class Base {
} else if (content.equals("evenodd")) {
this.paint.flagEvenOdd = true;
} else {
- Log.error("not know fill-rule value : \"" + content + "\", not in [nonzero,evenodd]");
+ LOGGER.error("not know fill-rule value : \"" + content + "\", not in [nonzero,evenodd]");
}
}
// ---------------- opacity ----------------
@@ -329,51 +332,56 @@ public class Base {
if (inputString.length() == 0) {
return;
}
- Log.verbose("indexOf transform : '" + inputString + "'");
+ LOGGER.trace("indexOf transform : '" + inputString + "'");
inputString = inputString.replace(',', ' ');
- Log.verbose("indexOf transform : '" + inputString + "'");
+ LOGGER.trace("indexOf transform : '" + inputString + "'");
// need to indexOf elements in order ...
String data = Base.extractTransformData(inputString, "matrix");
if (data.length() != 0) {
- double[] matrix = FMath.getTableDouble(data, " ", 6);
+ final double[] matrix = FMath.getTableDouble(data, " ", 6);
if (matrix != null) {
this.transformMatrix = new Matrix2x3f(matrix);
// indexOf a matrix : simply exit ...
return;
}
- Log.error("Parsing matrix() with wrong data ... '" + data + "'");
+ LOGGER.error("Parsing matrix() with wrong data ... '" + data + "'");
}
data = Base.extractTransformData(inputString, "translate");
if (data.length() != 0) {
- float[] elements = FMath.getTableFloat(data, " ", 2);
+ final float[] elements = FMath.getTableFloat(data, " ", 2);
if (elements != null) {
- this.transformMatrix = this.transformMatrix.multiply(Matrix2x3f.createTranslate(new Vector2f(elements[0], elements[1])));
- Log.verbose("Translate : " + elements[0] + ", " + elements[1]);
+ this.transformMatrix = this.transformMatrix
+ .multiply(Matrix2x3f.createTranslate(new Vector2f(elements[0], elements[1])));
+ LOGGER.trace("Translate : " + elements[0] + ", " + elements[1]);
} else {
- float elem = Float.parseFloat(data);
+ final float elem = Float.parseFloat(data);
this.transformMatrix = this.transformMatrix.multiply(Matrix2x3f.createTranslate(new Vector2f(elem, 0)));
}
}
data = Base.extractTransformData(inputString, "scale");
if (data.length() != 0) {
- float[] elements = FMath.getTableFloat(data, " ", 2);
+ final float[] elements = FMath.getTableFloat(data, " ", 2);
if (elements != null) {
- this.transformMatrix = this.transformMatrix.multiply(Matrix2x3f.createScale(new Vector2f(elements[0], elements[1])));
- Log.verbose("Translate : " + elements[0] + ", " + elements[1]);
+ this.transformMatrix = this.transformMatrix
+ .multiply(Matrix2x3f.createScale(new Vector2f(elements[0], elements[1])));
+ LOGGER.trace("Translate : " + elements[0] + ", " + elements[1]);
} else {
- float elem = Float.parseFloat(data);
+ final float elem = Float.parseFloat(data);
this.transformMatrix = this.transformMatrix.multiply(Matrix2x3f.createScale(elem));
}
}
data = Base.extractTransformData(inputString, "rotate");
if (data.length() != 0) {
- float[] elements = FMath.getTableFloat(data, " ", 3);
+ final float[] elements = FMath.getTableFloat(data, " ", 3);
if (elements != null) {
- float angle = (float) Math.toRadians(elements[0]);
- this.transformMatrix = this.transformMatrix.multiply(Matrix2x3f.createTranslate(new Vector2f(-elements[1], -elements[2])));
+ final float angle = (float) Math.toRadians(elements[0]);
+ this.transformMatrix = this.transformMatrix
+ .multiply(Matrix2x3f.createTranslate(new Vector2f(-elements[1], -elements[2])));
this.transformMatrix = this.transformMatrix.multiply(Matrix2x3f.createRotate(angle));
- this.transformMatrix = this.transformMatrix.multiply(Matrix2x3f.createTranslate(new Vector2f(elements[1], elements[2])));
- this.transformMatrix = this.transformMatrix.multiply(Matrix2x3f.createScale(new Vector2f(elements[0], elements[1])));
+ this.transformMatrix = this.transformMatrix
+ .multiply(Matrix2x3f.createTranslate(new Vector2f(elements[1], elements[2])));
+ this.transformMatrix = this.transformMatrix
+ .multiply(Matrix2x3f.createScale(new Vector2f(elements[0], elements[1])));
} else {
float elem = Float.parseFloat(data);
elem = (float) Math.toRadians(elem);
@@ -455,7 +463,7 @@ public class Base {
}
protected String spacingDist(final int spacing) {
- StringBuilder out = new StringBuilder();
+ final StringBuilder out = new StringBuilder();
for (int iii = 0; iii < spacing; iii++) {
out.append(" ");
}
diff --git a/src/org/atriasoft/esvg/Circle.java b/src/org/atriasoft/esvg/Circle.java
index 6488265..c8e168a 100644
--- a/src/org/atriasoft/esvg/Circle.java
+++ b/src/org/atriasoft/esvg/Circle.java
@@ -3,7 +3,6 @@ package org.atriasoft.esvg;
import java.util.ArrayList;
import java.util.List;
-import org.atriasoft.esvg.internal.Log;
import org.atriasoft.esvg.render.DynamicColor;
import org.atriasoft.esvg.render.PathModel;
import org.atriasoft.esvg.render.Point;
@@ -14,6 +13,8 @@ import org.atriasoft.etk.math.Matrix2x3f;
import org.atriasoft.etk.math.Vector2f;
import org.atriasoft.etk.util.Dynamic;
import org.atriasoft.exml.model.XmlElement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/** @file
* @author Edouard DUPIN
@@ -22,55 +23,61 @@ import org.atriasoft.exml.model.XmlElement;
*/
public class Circle extends Base {
+ static final Logger LOGGER = LoggerFactory.getLogger(Circle.class);
private Vector2f position; //!< Position of the Circle
private float radius; //!< Radius of the Circle
-
+
public Circle(final PaintState parentPaintState) {
super(parentPaintState);
}
-
+
public Circle(final Vector2f position, final float radius, final PaintState parentPaintState) {
super(parentPaintState);
this.position = position;
this.radius = radius;
}
-
+
private PathModel createPath() {
- PathModel out = new PathModel();
+ final PathModel out = new PathModel();
out.moveTo(false, this.position.addX(this.radius));
- out.curveTo(false, this.position.add(this.radius, this.radius * Base.kappa90), this.position.add(this.radius * Base.kappa90, this.radius), this.position.addY(this.radius));
- out.curveTo(false, this.position.add(-this.radius * Base.kappa90, this.radius), this.position.add(-this.radius, this.radius * Base.kappa90), this.position.lessX(this.radius));
- out.curveTo(false, this.position.add(-this.radius, -this.radius * Base.kappa90), this.position.add(-this.radius * Base.kappa90, -this.radius), this.position.lessY(this.radius));
- out.curveTo(false, this.position.add(this.radius * Base.kappa90, -this.radius), this.position.add(this.radius, -this.radius * Base.kappa90), this.position.addX(this.radius));
+ out.curveTo(false, this.position.add(this.radius, this.radius * Base.kappa90),
+ this.position.add(this.radius * Base.kappa90, this.radius), this.position.addY(this.radius));
+ out.curveTo(false, this.position.add(-this.radius * Base.kappa90, this.radius),
+ this.position.add(-this.radius, this.radius * Base.kappa90), this.position.lessX(this.radius));
+ out.curveTo(false, this.position.add(-this.radius, -this.radius * Base.kappa90),
+ this.position.add(-this.radius * Base.kappa90, -this.radius), this.position.lessY(this.radius));
+ out.curveTo(false, this.position.add(this.radius * Base.kappa90, -this.radius),
+ this.position.add(this.radius, -this.radius * Base.kappa90), this.position.addX(this.radius));
out.close();
return out;
}
-
+
@Override
public void display(final int spacing) {
- Log.debug(spacingDist(spacing) + "Circle " + this.position + " radius=" + this.radius);
+ LOGGER.debug(spacingDist(spacing) + "Circle " + this.position + " radius=" + this.radius);
}
-
+
@Override
public void draw(final Renderer myRenderer, final Matrix2x3f basicTrans, final int level) {
- Log.verbose(spacingDist(level) + "DRAW esvg::Circle");
+ LOGGER.trace(spacingDist(level) + "DRAW esvg::Circle");
if (this.radius <= 0.0f) {
- Log.verbose(spacingDist(level + 1) + "Too small radius" + this.radius);
+ LOGGER.trace(spacingDist(level + 1) + "Too small radius" + this.radius);
return;
}
- PathModel listElement = createPath();
-
+ final PathModel listElement = createPath();
+
Matrix2x3f mtx = this.transformMatrix;
mtx = mtx.multiply(basicTrans);
-
+
PointList listPoints = new PointList();
- listPoints = listElement.generateListPoints(level, myRenderer.getInterpolationRecurtionMax(), myRenderer.getInterpolationThreshold());
+ listPoints = listElement.generateListPoints(level, myRenderer.getInterpolationRecurtionMax(),
+ myRenderer.getInterpolationThreshold());
//listPoints.applyMatrix(mtx);
- SegmentList listSegmentFill = new SegmentList();
- SegmentList listSegmentStroke = new SegmentList();
- Weight tmpFill = new Weight();
- Weight tmpStroke = new Weight();
- DynamicColor colorFill = DynamicColor.createColor(this.paint.fill, mtx);
+ final SegmentList listSegmentFill = new SegmentList();
+ final SegmentList listSegmentStroke = new SegmentList();
+ final Weight tmpFill = new Weight();
+ final Weight tmpStroke = new Weight();
+ final DynamicColor colorFill = DynamicColor.createColor(this.paint.fill, mtx);
DynamicColor colorStroke = null;
if (this.paint.strokeWidth > 0.0f) {
colorStroke = DynamicColor.createColor(this.paint.stroke, mtx);
@@ -85,7 +92,8 @@ public class Circle extends Base {
}
// check if we need to display stroke:
if (colorStroke != null) {
- listSegmentStroke.createSegmentListStroke(listPoints, this.paint.strokeWidth, this.paint.lineCap, this.paint.lineJoin, this.paint.miterLimit);
+ listSegmentStroke.createSegmentListStroke(listPoints, this.paint.strokeWidth, this.paint.lineCap,
+ this.paint.lineJoin, this.paint.miterLimit);
colorStroke.setViewPort(listSegmentStroke.getViewPort());
listSegmentStroke.applyMatrix(mtx);
// now, traverse the scanlines and find the intersections on each scanline, use non-zero rule
@@ -96,25 +104,30 @@ public class Circle extends Base {
//myRenderer.addDebugSegment(listSegmentFill);
//myRenderer.addDebugSegment(listSegmentStroke);
}
-
+
@Override
- public void drawShapePoints(final List> out, final int recurtionMax, final float threshold, final Matrix2x3f basicTrans, final int level) {
- Log.verbose(spacingDist(level) + "DRAW Shape esvg::Circle");
- PathModel listElement = createPath();
+ public void drawShapePoints(
+ final List> out,
+ final int recurtionMax,
+ final float threshold,
+ final Matrix2x3f basicTrans,
+ final int level) {
+ LOGGER.trace(spacingDist(level) + "DRAW Shape esvg::Circle");
+ final PathModel listElement = createPath();
Matrix2x3f mtx = this.transformMatrix;
mtx = mtx.multiply(basicTrans);
PointList listPoints = new PointList();
listPoints = listElement.generateListPoints(level, recurtionMax, threshold);
listPoints.applyMatrix(mtx);
- for (List it : listPoints.data) {
- List listPoint = new ArrayList<>();
- for (Point itDot : it) {
+ for (final List it : listPoints.data) {
+ final List listPoint = new ArrayList<>();
+ for (final Point itDot : it) {
listPoint.add(itDot.pos);
}
out.add(listPoint);
}
}
-
+
@Override
public boolean parseXML(final XmlElement element, final Matrix2x3f parentTrans, final Dynamic sizeMax) {
this.radius = 0.0f;
@@ -124,10 +137,10 @@ public class Circle extends Base {
}
parseTransform(element);
parsePaintAttr(element);
-
+
// add the property of the parrent modifications ...
this.transformMatrix = this.transformMatrix.multiply(parentTrans);
-
+
String content = element.getAttribute("cx", "");
if (content.length() != 0) {
this.position = this.position.withX(parseLength(content));
@@ -138,13 +151,13 @@ public class Circle extends Base {
}
content = element.getAttribute("r", "");
if (content.length() == 0) {
- Log.error("Circle \"r\" is not present");
+ LOGGER.error("Circle \"r\" is not present");
return false;
}
this.radius = parseLength(content);
if (0 > this.radius) {
this.radius = 0;
- Log.error("Circle \"r\" is negative");
+ LOGGER.error("Circle \"r\" is negative");
return false;
}
sizeMax.value = new Vector2f(this.position.x() + this.radius, this.position.y() + this.radius);
diff --git a/src/org/atriasoft/esvg/Ellipse.java b/src/org/atriasoft/esvg/Ellipse.java
index e457417..2612366 100644
--- a/src/org/atriasoft/esvg/Ellipse.java
+++ b/src/org/atriasoft/esvg/Ellipse.java
@@ -2,7 +2,7 @@ package org.atriasoft.esvg;
import java.util.ArrayList;
import java.util.List;
-import org.atriasoft.esvg.internal.Log;
+
import org.atriasoft.esvg.render.DynamicColor;
import org.atriasoft.esvg.render.PathModel;
import org.atriasoft.esvg.render.Point;
@@ -13,6 +13,8 @@ import org.atriasoft.etk.math.Matrix2x3f;
import org.atriasoft.etk.math.Vector2f;
import org.atriasoft.etk.util.Dynamic;
import org.atriasoft.exml.model.XmlElement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/** @file
* @author Edouard DUPIN
@@ -21,55 +23,61 @@ import org.atriasoft.exml.model.XmlElement;
*/
public class Ellipse extends Base {
+ static final Logger LOGGER = LoggerFactory.getLogger(Ellipse.class);
private Vector2f c; //!< Center property of the ellipse
private Vector2f r; //!< Radius property of the ellipse
-
+
public Ellipse(final PaintState parentPaintState) {
super(parentPaintState);
}
-
+
public Ellipse(final Vector2f center, final Vector2f radius, final PaintState parentPaintState) {
super(parentPaintState);
this.c = center;
this.r = radius;
}
-
+
PathModel createPath() {
- PathModel out = new PathModel();
+ final PathModel out = new PathModel();
out.moveTo(false, this.c.add(this.r.x(), 0.0f));
- out.curveTo(false, this.c.add(this.r.x(), this.r.y() * Base.kappa90), this.c.add(this.r.x() * Base.kappa90, this.r.y()), this.c.add(0.0f, this.r.y()));
- out.curveTo(false, this.c.add(-this.r.x() * Base.kappa90, this.r.y()), this.c.add(-this.r.x(), this.r.y() * Base.kappa90), this.c.add(-this.r.x(), 0.0f));
- out.curveTo(false, this.c.add(-this.r.x(), -this.r.y() * Base.kappa90), this.c.add(-this.r.x() * Base.kappa90, -this.r.y()), this.c.add(0.0f, -this.r.y()));
- out.curveTo(false, this.c.add(this.r.x() * Base.kappa90, -this.r.y()), this.c.add(this.r.x(), -this.r.y() * Base.kappa90), this.c.add(this.r.x(), 0.0f));
+ out.curveTo(false, this.c.add(this.r.x(), this.r.y() * Base.kappa90),
+ this.c.add(this.r.x() * Base.kappa90, this.r.y()), this.c.add(0.0f, this.r.y()));
+ out.curveTo(false, this.c.add(-this.r.x() * Base.kappa90, this.r.y()),
+ this.c.add(-this.r.x(), this.r.y() * Base.kappa90), this.c.add(-this.r.x(), 0.0f));
+ out.curveTo(false, this.c.add(-this.r.x(), -this.r.y() * Base.kappa90),
+ this.c.add(-this.r.x() * Base.kappa90, -this.r.y()), this.c.add(0.0f, -this.r.y()));
+ out.curveTo(false, this.c.add(this.r.x() * Base.kappa90, -this.r.y()),
+ this.c.add(this.r.x(), -this.r.y() * Base.kappa90), this.c.add(this.r.x(), 0.0f));
out.close();
return out;
}
-
+
@Override
public void display(final int spacing) {
- Log.debug(spacingDist(spacing) + "Ellipse c=" + this.c + " r=" + this.r);
+ LOGGER.debug(spacingDist(spacing) + "Ellipse c=" + this.c + " r=" + this.r);
}
-
+
@Override
public void draw(final Renderer myRenderer, final Matrix2x3f basicTrans, final int level) {
- Log.verbose(spacingDist(level) + "DRAW esvg::Ellipse");
+ LOGGER.trace(spacingDist(level) + "DRAW esvg::Ellipse");
if (this.r.x() <= 0.0f || this.r.y() <= 0.0f) {
- Log.verbose(spacingDist(level + 1) + "Too small radius" + this.r);
+ LOGGER.trace(spacingDist(level + 1) + "Too small radius" + this.r);
return;
}
- PathModel listElement = createPath();
-
+ final PathModel listElement = createPath();
+
Matrix2x3f mtx = this.transformMatrix;
mtx = mtx.multiply(basicTrans);
-
+
PointList listPoints = new PointList();
- listPoints = listElement.generateListPoints(level, myRenderer.getInterpolationRecurtionMax(), myRenderer.getInterpolationThreshold());
+ listPoints = listElement.generateListPoints(level, myRenderer.getInterpolationRecurtionMax(),
+ myRenderer.getInterpolationThreshold());
//listPoints.applyMatrix(mtx);
- SegmentList listSegmentFill = new SegmentList();
- SegmentList listSegmentStroke = new SegmentList();
- Weight tmpFill = new Weight();
- Weight tmpStroke = new Weight();
- DynamicColor colorFill = DynamicColor.createColor(this.paint.fill, mtx);
+ final SegmentList listSegmentFill = new SegmentList();
+ final SegmentList listSegmentStroke = new SegmentList();
+ final Weight tmpFill = new Weight();
+ final Weight tmpStroke = new Weight();
+ final DynamicColor colorFill = DynamicColor.createColor(this.paint.fill, mtx);
DynamicColor colorStroke = null;
if (this.paint.strokeWidth > 0.0f) {
colorStroke = DynamicColor.createColor(this.paint.stroke, mtx);
@@ -84,7 +92,8 @@ public class Ellipse extends Base {
}
// check if we need to display stroke:
if (colorStroke != null) {
- listSegmentStroke.createSegmentListStroke(listPoints, this.paint.strokeWidth, this.paint.lineCap, this.paint.lineJoin, this.paint.miterLimit);
+ listSegmentStroke.createSegmentListStroke(listPoints, this.paint.strokeWidth, this.paint.lineCap,
+ this.paint.lineJoin, this.paint.miterLimit);
colorStroke.setViewPort(listSegmentStroke.getViewPort());
listSegmentStroke.applyMatrix(mtx);
// now, traverse the scanlines and find the intersections on each scanline, use non-zero rule
@@ -95,25 +104,30 @@ public class Ellipse extends Base {
//myRenderer.addDebugSegment(listSegmentFill);
//myRenderer.addDebugSegment(listSegmentStroke)
}
-
+
@Override
- public void drawShapePoints(final List> out, final int recurtionMax, final float threshold, final Matrix2x3f basicTrans, final int level) {
- Log.verbose(spacingDist(level) + "DRAW Shape esvg::Ellipse");
- PathModel listElement = createPath();
+ public void drawShapePoints(
+ final List> out,
+ final int recurtionMax,
+ final float threshold,
+ final Matrix2x3f basicTrans,
+ final int level) {
+ LOGGER.trace(spacingDist(level) + "DRAW Shape esvg::Ellipse");
+ final PathModel listElement = createPath();
Matrix2x3f mtx = this.transformMatrix;
mtx = mtx.multiply(basicTrans);
PointList listPoints;
listPoints = listElement.generateListPoints(level, recurtionMax, threshold);
listPoints.applyMatrix(mtx);
- for (List it : listPoints.data) {
- List listPoint = new ArrayList<>();
- for (Point itDot : it) {
+ for (final List it : listPoints.data) {
+ final List listPoint = new ArrayList<>();
+ for (final Point itDot : it) {
listPoint.add(itDot.pos);
}
out.add(listPoint);
}
}
-
+
@Override
public boolean parseXML(final XmlElement element, final Matrix2x3f parentTrans, final Dynamic sizeMax) {
if (element == null) {
@@ -121,13 +135,13 @@ public class Ellipse extends Base {
}
parseTransform(element);
parsePaintAttr(element);
-
+
// add the property of the parrent modifications ...
this.transformMatrix = this.transformMatrix.multiply(parentTrans);
-
+
this.c = Vector2f.ZERO;
this.r = Vector2f.ZERO;
-
+
String content = element.getAttribute("cx", "");
if (content.length() != 0) {
this.c = this.c.withX(parseLength(content));
@@ -138,18 +152,18 @@ public class Ellipse extends Base {
}
content = element.getAttribute("rx", "");
if (content.length() == 0) {
- Log.error("Ellipse \"rx\" is not present");
+ LOGGER.error("Ellipse \"rx\" is not present");
return false;
}
this.r = this.r.withX(parseLength(content));
content = element.getAttribute("ry", "");
if (content.length() == 0) {
- Log.error("Ellipse \"ry\" is not present");
+ LOGGER.error("Ellipse \"ry\" is not present");
return false;
}
this.r = this.r.withY(parseLength(content));
sizeMax.value = new Vector2f(this.c.x() + this.r.x(), this.c.y() + this.r.y());
-
+
return true;
}
}
diff --git a/src/org/atriasoft/esvg/EsvgDocument.java b/src/org/atriasoft/esvg/EsvgDocument.java
index fe37d33..05af93b 100644
--- a/src/org/atriasoft/esvg/EsvgDocument.java
+++ b/src/org/atriasoft/esvg/EsvgDocument.java
@@ -5,7 +5,6 @@ import java.util.List;
import org.atriasoft.aknot.exception.AknotException;
import org.atriasoft.egami.ImageFloatRGBA;
-import org.atriasoft.esvg.internal.Log;
import org.atriasoft.etk.Uri;
import org.atriasoft.etk.math.Matrix2x3f;
import org.atriasoft.etk.math.Vector2f;
@@ -16,8 +15,11 @@ import org.atriasoft.exml.exception.ExmlException;
import org.atriasoft.exml.exception.ExmlNodeDoesNotExist;
import org.atriasoft.exml.model.XmlElement;
import org.atriasoft.exml.model.XmlNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class EsvgDocument extends Base {
+ static final Logger LOGGER = LoggerFactory.getLogger(EsvgDocument.class);
private boolean loadOK = false;
private final List refList = new ArrayList<>();
private Vector2f size = Vector2f.ZERO;
@@ -25,19 +27,19 @@ public class EsvgDocument extends Base {
private String title = ""; //!< sub-element list
private Uri uri = null; //!< reference elements ...
private String version = "0.0";
-
+
public EsvgDocument() {
-
+
}
-
+
public EsvgDocument(final Vector2i size) {
this.size = new Vector2f(size.x(), size.y());
}
-
+
public void addElement(final Base elem) {
this.subElementList.add(elem);
}
-
+
/**
* change all style in a xml atribute
*/
@@ -55,7 +57,7 @@ public class EsvgDocument extends Base {
for (final String it1 : listStyle) {
final String[] value = it1.split(":");
if (value.length != 2) {
- Log.error("parsing style with a wrong patern : " + it1 + " missing ':'");
+ LOGGER.error("parsing style with a wrong patern : " + it1 + " missing ':'");
continue;
}
// TODO Check if the attibute already exist ...
@@ -70,7 +72,7 @@ public class EsvgDocument extends Base {
}
return true;
}
-
+
public void clear() {
this.uri = null;
this.version = "0.0";
@@ -78,54 +80,59 @@ public class EsvgDocument extends Base {
this.paint.clear();
this.size = Vector2f.ZERO;
}
-
+
/**
* Display all the node in the svg file.
*/
public void displayDebug() {
- Log.debug("Main SVG: size=" + this.size);
- Log.debug(" refs:");
- for (int iii = 0; iii < this.refList.size(); iii++) {
- if (this.refList.get(iii) != null) {
- this.refList.get(iii).display(2);
+ LOGGER.debug("Main SVG: size=" + this.size);
+ LOGGER.debug(" refs:");
+ for (final Base element : this.refList) {
+ if (element != null) {
+ element.display(2);
}
}
- Log.debug(" Nodes:");
- for (int iii = 0; iii < this.subElementList.size(); iii++) {
- if (this.subElementList.get(iii) != null) {
- this.subElementList.get(iii).display(2);
+ LOGGER.debug(" Nodes:");
+ for (final Base element : this.subElementList) {
+ if (element != null) {
+ element.display(2);
}
}
}
-
+
@Override
protected void draw(final Renderer myRenderer, final Matrix2x3f basicTrans, final int level) {
- for (int iii = 0; iii < this.subElementList.size(); iii++) {
- if (this.subElementList.get(iii) != null) {
- this.subElementList.get(iii).draw(myRenderer, basicTrans);
+ for (final Base element : this.subElementList) {
+ if (element != null) {
+ element.draw(myRenderer, basicTrans);
}
}
}
-
+
@Override
- protected void drawShapePoints(final List> out, final int recurtionMax, final float threshold, final Matrix2x3f basicTrans, final int level) {
- Log.verbose(spacingDist(level) + "DRAW shape EsvgDocument");
+ protected void drawShapePoints(
+ final List> out,
+ final int recurtionMax,
+ final float threshold,
+ final Matrix2x3f basicTrans,
+ final int level) {
+ LOGGER.trace(spacingDist(level) + "DRAW shape EsvgDocument");
for (final Base it : this.subElementList) {
if (it != null) {
it.drawShapePoints(out, recurtionMax, threshold, basicTrans, level + 1);
}
}
}
-
+
// TODO remove this fucntion : use generic function ...
public Vector2f getDefinedSize() {
return this.size;
}
-
+
public List> getLines() {
return getLines(new Vector2f(256, 256));
}
-
+
public List> getLines(Vector2f size) {
final List> out = new ArrayList<>();
if (size.x() <= 0) {
@@ -134,16 +141,17 @@ public class EsvgDocument extends Base {
if (size.y() <= 0) {
size = size.withY(this.size.y());
}
- Log.debug("lineification size " + size);
+ LOGGER.debug("lineification size " + size);
// create the first element matrix modification ...
- final Matrix2x3f basicTrans = Matrix2x3f.IDENTITY.multiply(Matrix2x3f.createScale(new Vector2f(size.x() / this.size.x(), size.y() / this.size.y())));
+ final Matrix2x3f basicTrans = Matrix2x3f.IDENTITY
+ .multiply(Matrix2x3f.createScale(new Vector2f(size.x() / this.size.x(), size.y() / this.size.y())));
drawShapePoints(out, 10, 0.25f, basicTrans);
return out;
}
-
+
public Base getReference(final String name) {
if (name.isEmpty()) {
- Log.error("request a reference with no name ... ");
+ LOGGER.error("request a reference with no name ... ");
return null;
}
for (final Base it : this.refList) {
@@ -154,14 +162,14 @@ public class EsvgDocument extends Base {
return it;
}
}
- Log.error("Can not find reference name : '" + name + "'");
+ LOGGER.error("Can not find reference name : '" + name + "'");
return null;
}
-
+
public boolean isLoadOk() {
return this.loadOK;
}
-
+
/*
//! @previous
public List renderImageFloatRGB(final Vector2i size) {
@@ -174,7 +182,7 @@ public class EsvgDocument extends Base {
}
return out;
}
-
+
//! @previous
public List> renderImageU8RGBA(final Vector2i size) {
List data = renderImageFloatRGBA(size);
@@ -186,7 +194,7 @@ public class EsvgDocument extends Base {
}
return out;
}
-
+
//! @previous
public List> renderImageU8RGB(final Vector2i size) {
List data = renderImageFloatRGBA(size);
@@ -230,7 +238,7 @@ public class EsvgDocument extends Base {
}
return this.loadOK;
}
-
+
/**
* parse a string that contain an svg stream
* @param data Data to parse
@@ -262,11 +270,11 @@ public class EsvgDocument extends Base {
}
return this.loadOK;
}
-
+
public boolean parseXMLData(final XmlElement root) {
return parseXMLData(root, false);
}
-
+
public boolean parseXMLData(final XmlElement root, final boolean isReference) {
// get the svg version :
this.version = root.getAttribute("version", "");
@@ -277,11 +285,11 @@ public class EsvgDocument extends Base {
pos = parseXmlPosition(root);
this.size = parseXmlSize(root);
parsePaintAttr(root);
- Log.verbose("parsed .ROOT trans: " + this.transformMatrix);
+ LOGGER.trace("parsed .ROOT trans: " + this.transformMatrix);
} else {
- Log.verbose("Parse Reference section ... (no attibute)");
+ LOGGER.trace("Parse Reference section ... (no attibute)");
}
-
+
Vector2f maxSize = Vector2f.ZERO;
final Dynamic size = new Dynamic<>(Vector2f.ZERO);
// parse all sub node:
@@ -294,7 +302,7 @@ public class EsvgDocument extends Base {
if (child.getValue().equals("g")) {
elementParser = new Group(this.paint);
} else if (child.getValue().equals("a")) {
- Log.info("Note : 'a' balise is parsed like a g balise ...");
+ LOGGER.info("Note : 'a' balise is parsed like a g balise ...");
elementParser = new Group(this.paint);
} else if (child.getValue().equals("title")) {
this.title = "TODO : set the title here ...";
@@ -317,19 +325,19 @@ public class EsvgDocument extends Base {
elementParser = new Text(this.paint);
} else if (child.getValue().equals("radialGradient")) {
if (!isReference) {
- Log.error("'" + child.getValue() + "' node must not be defined outside a defs Section");
+ LOGGER.error("'" + child.getValue() + "' node must not be defined outside a defs Section");
continue;
}
elementParser = new RadialGradient(this.paint);
} else if (child.getValue().equals("linearGradient")) {
if (!isReference) {
- Log.error("'" + child.getValue() + "' node must not be defined outside a defs Section");
+ LOGGER.error("'" + child.getValue() + "' node must not be defined outside a defs Section");
continue;
}
elementParser = new LinearGradient(this.paint);
} else if (child.getValue().equals("defs")) {
if (isReference) {
- Log.error("'" + child.getValue() + "' node must not be defined in a defs Section");
+ LOGGER.error("'" + child.getValue() + "' node must not be defined in a defs Section");
continue;
}
final boolean retRefs = parseXMLData(child, true);
@@ -342,14 +350,15 @@ public class EsvgDocument extends Base {
// Node ignore : generaly inkscape data
continue;
} else {
- Log.error("node not suported : '" + child.getValue() + "' must be [title,g,a,path,rect,circle,ellipse,line,polyline,polygon,text,metadata]");
+ LOGGER.error("node not suported : '" + child.getValue()
+ + "' must be [title,g,a,path,rect,circle,ellipse,line,polyline,polygon,text,metadata]");
}
if (elementParser == null) {
- Log.error("error on node: '" + child.getValue() + "' allocation error or not supported ...");
+ LOGGER.error("error on node: '" + child.getValue() + "' allocation error or not supported ...");
continue;
}
if (!elementParser.parseXML(child, this.transformMatrix, size)) {
- Log.error("error on node: '" + child.getValue() + "' Sub Parsing ERROR");
+ LOGGER.error("error on node: '" + child.getValue() + "' Sub Parsing ERROR");
elementParser = null;
continue;
}
@@ -376,12 +385,12 @@ public class EsvgDocument extends Base {
}
return true;
}
-
+
/*
public float[][] renderImageFloat(final Vector2i size) {
return renderImageFloat(size, false);
}
-
+
public float[][] renderImageFloat(Vector2i size, final boolean visualDebug) {
if (size == null) {
size = new Vector2i((int) this.size.x(), (int) this.size.y());
@@ -393,12 +402,12 @@ public class EsvgDocument extends Base {
size = size.withY((int) this.size.y());
}
}
- Log.debug("Generate size " + size);
+ LOGGER.debug("Generate size " + size);
Renderer renderedElement = new Renderer(size, this, visualDebug);
// create the first element matrix modification ...
Matrix2x3f basicTrans = Matrix2x3f.IDENTITY.multiply(Matrix2x3f.createScale(new Vector2f(size.x() / this.size.x(), size.y() / this.size.y())));
draw(renderedElement, basicTrans);
-
+
// direct return the generated data ...
return renderedElement.getData();
}
@@ -411,7 +420,7 @@ public class EsvgDocument extends Base {
public ImageFloatRGBA renderImageFloatRGBA(final Vector2i size) {
return renderImageFloatRGBA(size, false);
}
-
+
public ImageFloatRGBA renderImageFloatRGBA(Vector2i size, final boolean visualDebug) {
if (size == null) {
size = new Vector2i((int) this.size.x(), (int) this.size.y());
@@ -424,19 +433,20 @@ public class EsvgDocument extends Base {
}
}
if (size.x() <= 0) {
- Log.error("Generate size " + size);
+ LOGGER.error("Generate size " + size);
}
if (size.y() <= 0) {
- Log.error("Generate size " + size);
+ LOGGER.error("Generate size " + size);
}
- Log.verbose("Generate size " + size);
+ LOGGER.trace("Generate size " + size);
final Renderer renderedElement = new Renderer(size, this, visualDebug);
// create the first element matrix modification ...
- final Matrix2x3f basicTrans = Matrix2x3f.IDENTITY.multiply(Matrix2x3f.createScale(new Vector2f(size.x() / this.size.x(), size.y() / this.size.y())));
+ final Matrix2x3f basicTrans = Matrix2x3f.IDENTITY
+ .multiply(Matrix2x3f.createScale(new Vector2f(size.x() / this.size.x(), size.y() / this.size.y())));
draw(renderedElement, basicTrans);
-
+
// direct return the generated data ...
return renderedElement.getData();
}
-
+
}
diff --git a/src/org/atriasoft/esvg/EsvgFont.java b/src/org/atriasoft/esvg/EsvgFont.java
index bbca268..849b78d 100644
--- a/src/org/atriasoft/esvg/EsvgFont.java
+++ b/src/org/atriasoft/esvg/EsvgFont.java
@@ -8,7 +8,6 @@ import java.util.Map;
import org.atriasoft.aknot.exception.AknotException;
import org.atriasoft.esvg.font.Glyph;
import org.atriasoft.esvg.font.Kerning;
-import org.atriasoft.esvg.internal.Log;
import org.atriasoft.esvg.render.PathModel;
import org.atriasoft.esvg.render.RenderingConfig;
import org.atriasoft.esvg.render.Weight;
@@ -21,6 +20,8 @@ import org.atriasoft.exml.Exml;
import org.atriasoft.exml.exception.ExmlException;
import org.atriasoft.exml.model.XmlElement;
import org.atriasoft.exml.model.XmlNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
// https://www.w3.org/TR/SVGTiny12/fonts.html
@@ -52,11 +53,11 @@ import org.atriasoft.exml.model.XmlNode;
<------------------------> : advance.x
<------------> : sizeTexture.x
<---> : bearing.x
-
-
-
-
+
+
+
+
_
*----------------------* ^ ==> calculateFontRealHeight(fontSize);
| | | ^ ==> getAscent(fontSize);
@@ -72,12 +73,13 @@ import org.atriasoft.exml.model.XmlNode;
| | | |==> getDescent(fontSize);
| | | |
*----------------------* | |
-
-
+
+
*/
public class EsvgFont {
-
+ static final Logger LOGGER = LoggerFactory.getLogger(EsvgFont.class);
+
/**
* Load the file that might contain the svg
* @param uri File of the svg
@@ -99,24 +101,25 @@ public class EsvgFont {
return null;
}
if (!(doc instanceof final XmlElement root)) {
- Log.error("can not load the SVG font ==> wrong root node");
+ LOGGER.error("can not load the SVG font ==> wrong root node");
return null;
}
if (!root.existNode("svg") || !(root.getNodeNoExcept("svg") instanceof final XmlElement svgNode)) {
- Log.error("can not load Node