Skip to content

Commit

Permalink
Replace all control characters with an empty string from the <desc> e…
Browse files Browse the repository at this point in the history
…lement during rendering of the SVG file

Change-Id: Ib18e910eaa7872413099a7daacb66f14dbdb4e30
  • Loading branch information
mhouthuijzen committed Apr 11, 2017
1 parent 817bfbc commit b12fd4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ bin/
.settings/
.classpath
.project

.idea/
12 changes: 6 additions & 6 deletions src/main/java/uk/org/okapibarcode/output/SvgRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@

package uk.org.okapibarcode.output;

import java.awt.Color;
import uk.org.okapibarcode.backend.Hexagon;
import uk.org.okapibarcode.backend.Symbol;
import uk.org.okapibarcode.backend.TextBox;

import java.awt.*;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Rectangle2D;
import java.io.IOException;
import java.io.OutputStream;

import uk.org.okapibarcode.backend.Hexagon;
import uk.org.okapibarcode.backend.Symbol;
import uk.org.okapibarcode.backend.TextBox;

/**
* Renders symbologies to SVG (Scalable Vector Graphics).
*
Expand Down Expand Up @@ -75,7 +75,7 @@ public void render(Symbol symbol) throws IOException {
if (content == null || content.isEmpty()) {
title = "OkapiBarcode Generated Symbol";
} else {
title = content;
title = content.replaceAll("[\u0000-\u001f]", "");
}

String fgColour = String.format("%02X", ink.getRed())
Expand Down

0 comments on commit b12fd4c

Please sign in to comment.