diff --git a/Readme.md b/Readme.md
index 2a5b960..99652ca 100644
--- a/Readme.md
+++ b/Readme.md
@@ -18,7 +18,7 @@ Install through [composer](https://getcomposer.org/doc/00-intro.md):
composer require picqer/php-barcode-generator
```
-If you want to generate PNG or JPG images, you need the GD library or Imagick installed on your system as well.
+If you want to generate PNG or JPG images, you need the GD library or Imagick installed on your system as well. For SVG or HTML renders, there are no dependencies.
## Usage
You want a barcode for a specific "type" (for example Code 128 or UPC) in a specific image format (for example PNG or SVG).
@@ -54,21 +54,28 @@ $barcode = (new Picqer\Barcode\Types\TypeCode128())->getBarcode('081231723897');
$renderer = new Picqer\Barcode\Renderers\PngRenderer();
$renderer->setForegroundColor($colorRed);
-// Save PNG to the filesystem, with widthFactor 3 and height of 50 pixels
-file_put_contents('barcode.png', $renderer->render($barcode, 3, 50));
+// Save PNG to the filesystem, with widthFactor 3 (width of the barcode x 3) and height of 50 pixels
+file_put_contents('barcode.png', $renderer->render($barcode, $barcode->getWidth() * 3, 50));
```
## Image renderers
Available image renderers: SVG, PNG, JPG and HTML.
-Each renderer has their own options. Only the barcode is required, the rest is optional. Here are all the options for each renderers:
+They all conform to the RendererInterface and have the same `render()` method. Some renderers have extra options as well, via set*() methods.
+
+### Widths
+The render() method needs the Barcode object, the width and height. **For JPG/PNG images**, you only get a valid barcode if you give a width that is a factor of the width of the Barcode object. That is why the examples show `$barcode->getWidth() * 2` to make the image 2 times wider in pixels then the width of the barcode data. You *can* give an arbitrary number as width and the image will be scaled as best as possible, but without anti-aliasing, it will not be perfectly valid.
+
+HTML and SVG renderers can handle any width and height, even floats.
+
+Here are all the options for each renderer:
### SVG
A vector based SVG image. Gives the best quality to print.
```php
$renderer = new Picqer\Barcode\Renderers\SvgRenderer();
-$renderer->setForegroundColor('red'); // Give a color for the bars, default is black
-$renderer->setBackgroundColor('blue'); // Give a color for the background, default is transparent
+$renderer->setForegroundColor([255, 0, 0]); // Give a color red for the bars, default is black. Give it as 3 times 0-255 values for red, green and blue.
+$renderer->setBackgroundColor([0, 0, 255]); // Give a color blue for the background, default is transparent. Give it as 3 times 0-255 values for red, green and blue.
$renderer->setSvgType($renderer::TYPE_SVG_INLINE); // Changes the output to be used inline inside HTML documents, instead of a standalone SVG image (default)
$renderer->setSvgType($renderer::TYPE_SVG_STANDALONE); // If you want to force the default, create a stand alone SVG image
@@ -91,8 +98,8 @@ $renderer->render($barcode, 5, 40); // Width factor (how many pixel wide every b
Gives HTML to use inline in a full HTML document.
```php
$renderer = new Picqer\Barcode\Renderers\HtmlRenderer();
-$renderer->setForegroundColor('red'); // Give a color for the bars, default is black
-$renderer->setBackgroundColor('blue'); // Give a color for the background, default is transparent
+$renderer->setForegroundColor([255, 0, 0]); // Give a color red for the bars, default is black. Give it as 3 times 0-255 values for red, green and blue.
+$renderer->setBackgroundColor([0, 0, 255]); // Give a color blue for the background, default is transparent. Give it as 3 times 0-255 values for red, green and blue.
$renderer->render($barcode, 450.20, 75); // Width and height support floats
````
@@ -101,8 +108,8 @@ $renderer->render($barcode, 450.20, 75); // Width and height support floats
Give HTML here the barcode is using the full width and height, to put inside a container/div that has a fixed size.
```php
$renderer = new Picqer\Barcode\Renderers\DynamicHtmlRenderer();
-$renderer->setForegroundColor('red'); // Give a color for the bars, default is black
-$renderer->setBackgroundColor('blue'); // Give a color for the background, default is transparent
+$renderer->setForegroundColor([255, 0, 0]); // Give a color red for the bars, default is black. Give it as 3 times 0-255 values for red, green and blue.
+$renderer->setBackgroundColor([0, 0, 255]); // Give a color blue for the background, default is transparent. Give it as 3 times 0-255 values for red, green and blue.
$renderer->render($barcode);
````
@@ -163,7 +170,7 @@ If you want to use PNG or JPG images, you need to install [Imagick](https://www.
```php
$barcode = (new Picqer\Barcode\Types\TypeCode128())->getBarcode('081231723897');
$renderer = new Picqer\Barcode\Renderers\PngRenderer();
-echo ' ';
+echo ' ';
```
### Save JPG barcode to disk
@@ -171,7 +178,7 @@ echo ' ' . PHP_EOL;
+ $html = '
' . PHP_EOL;
$positionHorizontal = 0;
/** @var BarcodeBar $bar */
@@ -26,7 +27,7 @@ public function render(Barcode $barcode): string
$positionVertical = round(($bar->getPositionVertical() / $barcode->getHeight() * 100), 3);
// draw a vertical bar
- $html .= '
' . PHP_EOL;
+ $html .= '
' . PHP_EOL;
}
$positionHorizontal += $barWidth;
@@ -37,15 +38,13 @@ public function render(Barcode $barcode): string
return $html;
}
- // Use HTML color definitions, like 'red' or '#ff0000'
- public function setForegroundColor(string $color): self
+ public function setForegroundColor(array $color): self
{
$this->foregroundColor = $color;
return $this;
}
- // Use HTML color definitions, like 'red' or '#ff0000'
- public function setBackgroundColor(?string $color): self
+ public function setBackgroundColor(?array $color): self
{
$this->backgroundColor = $color;
return $this;
diff --git a/src/Renderers/HtmlRenderer.php b/src/Renderers/HtmlRenderer.php
index fae8ffa..9b93651 100644
--- a/src/Renderers/HtmlRenderer.php
+++ b/src/Renderers/HtmlRenderer.php
@@ -5,16 +5,16 @@
use Picqer\Barcode\Barcode;
use Picqer\Barcode\BarcodeBar;
-class HtmlRenderer
+class HtmlRenderer implements RendererInterface
{
- protected string $foregroundColor = 'black';
- protected ?string $backgroundColor = null;
+ protected array $foregroundColor = [0, 0, 0];
+ protected ?array $backgroundColor = null;
public function render(Barcode $barcode, float $width = 200, float $height = 30): string
{
$widthFactor = $width / $barcode->getWidth();
- $html = '
' . PHP_EOL;
+ $html = '
' . PHP_EOL;
$positionHorizontal = 0;
/** @var BarcodeBar $bar */
@@ -26,7 +26,7 @@ public function render(Barcode $barcode, float $width = 200, float $height = 30)
$positionVertical = round(($bar->getPositionVertical() * $height / $barcode->getHeight()), 3);
// draw a vertical bar
- $html .= '
' . PHP_EOL;
+ $html .= '
' . PHP_EOL;
}
$positionHorizontal += $barWidth;
@@ -37,15 +37,13 @@ public function render(Barcode $barcode, float $width = 200, float $height = 30)
return $html;
}
- // Use HTML color definitions, like 'red' or '#ff0000'
- public function setForegroundColor(string $color): self
+ public function setForegroundColor(array $color): self
{
$this->foregroundColor = $color;
return $this;
}
- // Use HTML color definitions, like 'red' or '#ff0000'
- public function setBackgroundColor(?string $color): self
+ public function setBackgroundColor(?array $color): self
{
$this->backgroundColor = $color;
return $this;
diff --git a/src/Renderers/PngRenderer.php b/src/Renderers/PngRenderer.php
index 226a7b7..72c2909 100644
--- a/src/Renderers/PngRenderer.php
+++ b/src/Renderers/PngRenderer.php
@@ -9,7 +9,7 @@
use Picqer\Barcode\BarcodeBar;
use Picqer\Barcode\Exceptions\BarcodeException;
-class PngRenderer
+class PngRenderer implements RendererInterface
{
protected array $foregroundColor = [0, 0, 0];
protected ?array $backgroundColor = null;
@@ -49,9 +49,15 @@ public function useGd(): self
return $this;
}
- public function render(Barcode $barcode, int $widthFactor = 2, int $height = 30): string
+ // Floats in width and height will be rounded to integers
+ // For best (and valid) result, use a width as a factor of the width of the Barcode object
+ // Example: $width = $barcode->getWidth() * 3
+ public function render(Barcode $barcode, float $width = 200, float $height = 30): string
{
- $width = (int)round($barcode->getWidth() * $widthFactor);
+ $width = (int)round($width);
+ $height = (int)round($height);
+
+ $widthFactor = $width / $barcode->getWidth();
if ($this->useImagick) {
$image = $this->createImagickImageObject($width, $height);
@@ -66,7 +72,7 @@ public function render(Barcode $barcode, int $widthFactor = 2, int $height = 30)
$positionHorizontal = 0;
/** @var BarcodeBar $bar */
foreach ($barcode->getBars() as $bar) {
- $barWidth = (int)round(($bar->getWidth() * $widthFactor));
+ $barWidth = $bar->getWidth() * $widthFactor;
if ($bar->isBar() && $barWidth > 0) {
$y = (int)round(($bar->getPositionVertical() * $height / $barcode->getHeight()));
@@ -74,9 +80,9 @@ public function render(Barcode $barcode, int $widthFactor = 2, int $height = 30)
// draw a vertical bar
if ($this->useImagick) {
- $imagickBarsShape->rectangle($positionHorizontal, $y, ($positionHorizontal + $barWidth - 1), ($y + $barHeight));
+ $imagickBarsShape->rectangle((int)round($positionHorizontal), $y, (int)round($positionHorizontal + $barWidth - 1), ($y + $barHeight));
} else {
- \imagefilledrectangle($image, $positionHorizontal, $y, ($positionHorizontal + $barWidth - 1), ($y + $barHeight), $gdForegroundColor);
+ \imagefilledrectangle($image, (int)round($positionHorizontal), $y, (int)round($positionHorizontal + $barWidth - 1), ($y + $barHeight), $gdForegroundColor);
}
}
$positionHorizontal += $barWidth;
diff --git a/src/Renderers/RendererInterface.php b/src/Renderers/RendererInterface.php
new file mode 100644
index 0000000..eaba33d
--- /dev/null
+++ b/src/Renderers/RendererInterface.php
@@ -0,0 +1,14 @@
+backgroundColor !== null) {
- $svg .= "\t" . '
' . PHP_EOL;
+ $svg .= "\t" . '
' . PHP_EOL;
}
- $svg .= "\t" . '
' . PHP_EOL;
+ $svg .= "\t" . '' . PHP_EOL;
// print bars
$positionHorizontal = 0;
@@ -56,13 +56,13 @@ public function render(Barcode $barcode, float $width = 200, float $height = 30)
return $svg;
}
- public function setForegroundColor(string $color): self
+ public function setForegroundColor(array $color): self
{
$this->foregroundColor = $color;
return $this;
}
- public function setBackgroundColor(?string $color): self
+ public function setBackgroundColor(?array $color): self
{
$this->backgroundColor = $color;
return $this;
diff --git a/tests/HtmlRendererTest.php b/tests/HtmlRendererTest.php
index 387a43e..2435886 100644
--- a/tests/HtmlRendererTest.php
+++ b/tests/HtmlRendererTest.php
@@ -29,7 +29,7 @@ public function test_html_barcode_generator_with_background()
$barcode = (new Picqer\Barcode\Types\TypeCode128())->getBarcode('081231723897');
$renderer = new Picqer\Barcode\Renderers\HtmlRenderer();
- $renderer->setBackgroundColor('red');
+ $renderer->setBackgroundColor([255, 0, 0]);
$generated = $renderer->render($barcode, $barcode->getWidth() * 2);
$this->assertStringEqualsFile('tests/verified-files/081231723897-code128-red-background.html', $generated);
diff --git a/tests/JpgRendererTest.php b/tests/JpgRendererTest.php
index 46aa939..c6ca4c6 100644
--- a/tests/JpgRendererTest.php
+++ b/tests/JpgRendererTest.php
@@ -10,7 +10,7 @@ public function test_jpg_barcode_generator_can_generate_code_128_barcode()
$renderer = new Picqer\Barcode\Renderers\JpgRenderer();
$renderer->useGd();
- $generated = $renderer->render($barcode);
+ $generated = $renderer->render($barcode, $barcode->getWidth() * 2);
$imageInfo = getimagesizefromstring($generated);
@@ -27,7 +27,7 @@ public function test_jpg_barcode_generator_can_generate_code_39_barcode()
$renderer = new Picqer\Barcode\Renderers\JpgRenderer();
$renderer->useGd();
- $generated = $renderer->render($barcode, 1);
+ $generated = $renderer->render($barcode, $barcode->getWidth());
$imageInfo = getimagesizefromstring($generated);
@@ -43,7 +43,7 @@ public function test_jpg_barcode_generator_can_use_different_height()
$renderer = new Picqer\Barcode\Renderers\JpgRenderer();
$renderer->useGd();
- $generated = $renderer->render($barcode, 2, 45);
+ $generated = $renderer->render($barcode, $barcode->getWidth() * 2, 45);
$imageInfo = getimagesizefromstring($generated);
@@ -59,7 +59,7 @@ public function test_jpg_barcode_generator_can_use_different_width_factor()
$renderer = new Picqer\Barcode\Renderers\JpgRenderer();
$renderer->useGd();
- $generated = $renderer->render($barcode, 5);
+ $generated = $renderer->render($barcode, $barcode->getWidth() * 5);
$imageInfo = getimagesizefromstring($generated);
@@ -81,7 +81,7 @@ public function test_jpg_barcode_generator_can_generate_code_128_barcode_imagick
$renderer = new Picqer\Barcode\Renderers\JpgRenderer();
$renderer->useImagick();
- $generated = $renderer->render($barcode);
+ $generated = $renderer->render($barcode, $barcode->getWidth() * 2);
$imageInfo = getimagesizefromstring($generated);
@@ -101,7 +101,7 @@ public function test_jpg_barcode_generator_can_generate_code_39_barcode_imagick(
$renderer = new Picqer\Barcode\Renderers\JpgRenderer();
$renderer->useImagick();
- $generated = $renderer->render($barcode, 1);
+ $generated = $renderer->render($barcode, $barcode->getWidth());
$imageInfo = getimagesizefromstring($generated);
@@ -121,7 +121,7 @@ public function test_jpg_barcode_generator_can_use_different_height_imagick()
$renderer = new Picqer\Barcode\Renderers\JpgRenderer();
$renderer->useGd();
- $generated = $renderer->render($barcode, 2, 45);
+ $generated = $renderer->render($barcode, $barcode->getWidth() * 2, 45);
$imageInfo = getimagesizefromstring($generated);
@@ -141,7 +141,7 @@ public function test_jpg_barcode_generator_can_use_different_width_factor_imagic
$renderer = new Picqer\Barcode\Renderers\JpgRenderer();
$renderer->useGd();
- $generated = $renderer->render($barcode, 5);
+ $generated = $renderer->render($barcode, $barcode->getWidth() * 5);
$imageInfo = getimagesizefromstring($generated);
diff --git a/tests/PngRendererTest.php b/tests/PngRendererTest.php
index db253ce..fbb3e3c 100644
--- a/tests/PngRendererTest.php
+++ b/tests/PngRendererTest.php
@@ -22,7 +22,7 @@ public function test_png_barcode_generator_can_generate_code_39_barcode()
$renderer = new Picqer\Barcode\Renderers\PngRenderer();
$renderer->useGd();
- $generated = $renderer->render($barcode, 1);
+ $generated = $renderer->render($barcode, $barcode->getWidth());
$imageInfo = getimagesizefromstring($generated);
@@ -38,7 +38,7 @@ public function test_png_barcode_generator_can_use_different_height()
$renderer = new Picqer\Barcode\Renderers\PngRenderer();
$renderer->useGd();
- $generated = $renderer->render($barcode, 2, 45);
+ $generated = $renderer->render($barcode, $barcode->getWidth() * 2, 45);
$imageInfo = getimagesizefromstring($generated);
@@ -54,7 +54,7 @@ public function test_png_barcode_generator_can_use_different_width_factor()
$renderer = new Picqer\Barcode\Renderers\PngRenderer();
$renderer->useGd();
- $generated = $renderer->render($barcode, 5);
+ $generated = $renderer->render($barcode, $barcode->getWidth() * 5);
$imageInfo = getimagesizefromstring($generated);
@@ -76,7 +76,7 @@ public function test_png_barcode_generator_can_generate_code_128_barcode_imagick
$renderer = new Picqer\Barcode\Renderers\PngRenderer();
$renderer->useImagick();
- $generated = $renderer->render($barcode);
+ $generated = $renderer->render($barcode, $barcode->getWidth() * 2);
$this->assertEquals('PNG', substr($generated, 1, 3));
}
@@ -91,7 +91,7 @@ public function test_png_barcode_generator_can_generate_code_39_barcode_imagick(
$renderer = new Picqer\Barcode\Renderers\PngRenderer();
$renderer->useImagick();
- $generated = $renderer->render($barcode, 1);
+ $generated = $renderer->render($barcode, $barcode->getWidth());
$imageInfo = getimagesizefromstring($generated);
@@ -111,7 +111,7 @@ public function test_png_barcode_generator_can_use_different_height_imagick()
$renderer = new Picqer\Barcode\Renderers\PngRenderer();
$renderer->useGd();
- $generated = $renderer->render($barcode, 2, 45);
+ $generated = $renderer->render($barcode, $barcode->getWidth() * 2, 45);
$imageInfo = getimagesizefromstring($generated);
@@ -131,7 +131,7 @@ public function test_png_barcode_generator_can_use_different_width_factor_imagic
$renderer = new Picqer\Barcode\Renderers\PngRenderer();
$renderer->useGd();
- $generated = $renderer->render($barcode, 5);
+ $generated = $renderer->render($barcode, $barcode->getWidth() * 5);
$imageInfo = getimagesizefromstring($generated);
diff --git a/tests/SvgRendererTest.php b/tests/SvgRendererTest.php
index a8d73e6..984d034 100644
--- a/tests/SvgRendererTest.php
+++ b/tests/SvgRendererTest.php
@@ -62,7 +62,7 @@ public function test_svg_barcode_generator_can_use_background_color()
$barcode = (new Picqer\Barcode\Types\TypeEan13())->getBarcode('081231723897');
$renderer = new Picqer\Barcode\Renderers\SvgRenderer();
- $renderer->setBackgroundColor('red');
+ $renderer->setBackgroundColor([255, 0, 0]);
$generated = $renderer->render($barcode, 190);
$this->assertStringEqualsFile('tests/verified-files/081231723897-ean13-red-background.svg', $generated);
diff --git a/tests/verified-files/0049000004632-ean13.svg b/tests/verified-files/0049000004632-ean13.svg
index 427ff40..5c46159 100644
--- a/tests/verified-files/0049000004632-ean13.svg
+++ b/tests/verified-files/0049000004632-ean13.svg
@@ -2,7 +2,7 @@
0049000004632
-
+
diff --git a/tests/verified-files/081231723897-code128-red-background.html b/tests/verified-files/081231723897-code128-red-background.html
index 6023c22..45f6b31 100644
--- a/tests/verified-files/081231723897-code128-red-background.html
+++ b/tests/verified-files/081231723897-code128-red-background.html
@@ -1,30 +1,30 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/verified-files/081231723897-code128.html b/tests/verified-files/081231723897-code128.html
index e9cf37a..7b3f9f2 100644
--- a/tests/verified-files/081231723897-code128.html
+++ b/tests/verified-files/081231723897-code128.html
@@ -1,30 +1,30 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/verified-files/081231723897-dynamic-code128.html b/tests/verified-files/081231723897-dynamic-code128.html
index cdf2d94..6d88107 100644
--- a/tests/verified-files/081231723897-dynamic-code128.html
+++ b/tests/verified-files/081231723897-dynamic-code128.html
@@ -1,30 +1,30 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/verified-files/081231723897-ean13-fractional-width.svg b/tests/verified-files/081231723897-ean13-fractional-width.svg
index d616490..2ff2967 100644
--- a/tests/verified-files/081231723897-ean13-fractional-width.svg
+++ b/tests/verified-files/081231723897-ean13-fractional-width.svg
@@ -2,7 +2,7 @@
0812317238973
-
+
diff --git a/tests/verified-files/081231723897-ean13-red-background.svg b/tests/verified-files/081231723897-ean13-red-background.svg
index 406af57..52bad4d 100644
--- a/tests/verified-files/081231723897-ean13-red-background.svg
+++ b/tests/verified-files/081231723897-ean13-red-background.svg
@@ -2,8 +2,8 @@
0812317238973
-
-
+
+
diff --git a/tests/verified-files/081231723897-ean13.svg b/tests/verified-files/081231723897-ean13.svg
index 96e1619..a396439 100644
--- a/tests/verified-files/081231723897-ean13.svg
+++ b/tests/verified-files/081231723897-ean13.svg
@@ -2,7 +2,7 @@
0812317238973
-
+
diff --git a/tests/verified-files/12345678903-dynamic-imb.html b/tests/verified-files/12345678903-dynamic-imb.html
index c06f1fb..7142156 100644
--- a/tests/verified-files/12345678903-dynamic-imb.html
+++ b/tests/verified-files/12345678903-dynamic-imb.html
@@ -1,67 +1,67 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/verified-files/12345678903-imb.html b/tests/verified-files/12345678903-imb.html
index eba3400..7620abc 100644
--- a/tests/verified-files/12345678903-imb.html
+++ b/tests/verified-files/12345678903-imb.html
@@ -1,67 +1,67 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/verified-files/TypeCodabar-123456789.svg b/tests/verified-files/TypeCodabar-123456789.svg
index 0d9606a..0bbe6d1 100644
--- a/tests/verified-files/TypeCodabar-123456789.svg
+++ b/tests/verified-files/TypeCodabar-123456789.svg
@@ -2,7 +2,7 @@
123456789
-
+
diff --git a/tests/verified-files/TypeCode11-123456789.svg b/tests/verified-files/TypeCode11-123456789.svg
index f30d919..8c8eb3f 100644
--- a/tests/verified-files/TypeCode11-123456789.svg
+++ b/tests/verified-files/TypeCode11-123456789.svg
@@ -2,7 +2,7 @@
123456789
-
+
diff --git a/tests/verified-files/TypeCode128-081231723897.svg b/tests/verified-files/TypeCode128-081231723897.svg
index 64b544f..d7267ab 100644
--- a/tests/verified-files/TypeCode128-081231723897.svg
+++ b/tests/verified-files/TypeCode128-081231723897.svg
@@ -2,7 +2,7 @@
081231723897
-
+
diff --git a/tests/verified-files/TypeCode128-1234567890abcABC-283-33.svg b/tests/verified-files/TypeCode128-1234567890abcABC-283-33.svg
index 4a3708a..32b8c1f 100644
--- a/tests/verified-files/TypeCode128-1234567890abcABC-283-33.svg
+++ b/tests/verified-files/TypeCode128-1234567890abcABC-283-33.svg
@@ -2,7 +2,7 @@
1234567890abcABC-283*33
-
+
diff --git a/tests/verified-files/TypeCode128A-1234567890.svg b/tests/verified-files/TypeCode128A-1234567890.svg
index 22d2cf4..9964f3d 100644
--- a/tests/verified-files/TypeCode128A-1234567890.svg
+++ b/tests/verified-files/TypeCode128A-1234567890.svg
@@ -2,7 +2,7 @@
1234567890
-
+
diff --git a/tests/verified-files/TypeCode128B-081231723897.svg b/tests/verified-files/TypeCode128B-081231723897.svg
index f3ee4e0..99133e9 100644
--- a/tests/verified-files/TypeCode128B-081231723897.svg
+++ b/tests/verified-files/TypeCode128B-081231723897.svg
@@ -2,7 +2,7 @@
081231723897
-
+
diff --git a/tests/verified-files/TypeCode128B-1234567890abcABC-283-33.svg b/tests/verified-files/TypeCode128B-1234567890abcABC-283-33.svg
index ec25033..9d79a94 100644
--- a/tests/verified-files/TypeCode128B-1234567890abcABC-283-33.svg
+++ b/tests/verified-files/TypeCode128B-1234567890abcABC-283-33.svg
@@ -2,7 +2,7 @@
1234567890abcABC-283*33
-
+
diff --git a/tests/verified-files/TypeCode39-1234567890ABC.svg b/tests/verified-files/TypeCode39-1234567890ABC.svg
index 448792d..a028564 100644
--- a/tests/verified-files/TypeCode39-1234567890ABC.svg
+++ b/tests/verified-files/TypeCode39-1234567890ABC.svg
@@ -2,7 +2,7 @@
*1234567890ABC*
-
+
diff --git a/tests/verified-files/TypeCode39Checksum-1234567890ABC.svg b/tests/verified-files/TypeCode39Checksum-1234567890ABC.svg
index 280551a..00a99a7 100644
--- a/tests/verified-files/TypeCode39Checksum-1234567890ABC.svg
+++ b/tests/verified-files/TypeCode39Checksum-1234567890ABC.svg
@@ -2,7 +2,7 @@
*1234567890ABCZ*
-
+
diff --git a/tests/verified-files/TypeCode39Extended-1234567890abcABC.svg b/tests/verified-files/TypeCode39Extended-1234567890abcABC.svg
index d85cc71..39fc3e3 100644
--- a/tests/verified-files/TypeCode39Extended-1234567890abcABC.svg
+++ b/tests/verified-files/TypeCode39Extended-1234567890abcABC.svg
@@ -2,7 +2,7 @@
*1234567890+A+B+CABC*
-
+
diff --git a/tests/verified-files/TypeCode39ExtendedChecksum-1234567890abcABC.svg b/tests/verified-files/TypeCode39ExtendedChecksum-1234567890abcABC.svg
index a1a87c5..a6880d6 100644
--- a/tests/verified-files/TypeCode39ExtendedChecksum-1234567890abcABC.svg
+++ b/tests/verified-files/TypeCode39ExtendedChecksum-1234567890abcABC.svg
@@ -2,7 +2,7 @@
*1234567890+A+B+CABCJ*
-
+
diff --git a/tests/verified-files/TypeCode93-1234567890abcABC.svg b/tests/verified-files/TypeCode93-1234567890abcABC.svg
index 120c36f..efa0b6e 100644
--- a/tests/verified-files/TypeCode93-1234567890abcABC.svg
+++ b/tests/verified-files/TypeCode93-1234567890abcABC.svg
@@ -2,7 +2,7 @@
*1234567890dAdBdCABC6-*
-
+
diff --git a/tests/verified-files/TypeEan13-004900000463.svg b/tests/verified-files/TypeEan13-004900000463.svg
index 427ff40..5c46159 100644
--- a/tests/verified-files/TypeEan13-004900000463.svg
+++ b/tests/verified-files/TypeEan13-004900000463.svg
@@ -2,7 +2,7 @@
0049000004632
-
+
diff --git a/tests/verified-files/TypeEan13-0049000004632.svg b/tests/verified-files/TypeEan13-0049000004632.svg
index 427ff40..5c46159 100644
--- a/tests/verified-files/TypeEan13-0049000004632.svg
+++ b/tests/verified-files/TypeEan13-0049000004632.svg
@@ -2,7 +2,7 @@
0049000004632
-
+
diff --git a/tests/verified-files/TypeEan13-081231723897.svg b/tests/verified-files/TypeEan13-081231723897.svg
index 96e1619..a396439 100644
--- a/tests/verified-files/TypeEan13-081231723897.svg
+++ b/tests/verified-files/TypeEan13-081231723897.svg
@@ -2,7 +2,7 @@
0812317238973
-
+
diff --git a/tests/verified-files/TypeEan8-1234568.svg b/tests/verified-files/TypeEan8-1234568.svg
index 9c4e210..2dc590c 100644
--- a/tests/verified-files/TypeEan8-1234568.svg
+++ b/tests/verified-files/TypeEan8-1234568.svg
@@ -2,7 +2,7 @@
12345687
-
+
diff --git a/tests/verified-files/TypeITF14-00012345600012.svg b/tests/verified-files/TypeITF14-00012345600012.svg
index 25553f0..c2a317b 100644
--- a/tests/verified-files/TypeITF14-00012345600012.svg
+++ b/tests/verified-files/TypeITF14-00012345600012.svg
@@ -2,7 +2,7 @@
00012345600012
-
+
diff --git a/tests/verified-files/TypeITF14-05400141288766.svg b/tests/verified-files/TypeITF14-05400141288766.svg
index ece67b7..dd1a0b9 100644
--- a/tests/verified-files/TypeITF14-05400141288766.svg
+++ b/tests/verified-files/TypeITF14-05400141288766.svg
@@ -2,7 +2,7 @@
05400141288766
-
+
diff --git a/tests/verified-files/TypeIntelligentMailBarcode-123456789.svg b/tests/verified-files/TypeIntelligentMailBarcode-123456789.svg
index a82dcd9..8637b41 100644
--- a/tests/verified-files/TypeIntelligentMailBarcode-123456789.svg
+++ b/tests/verified-files/TypeIntelligentMailBarcode-123456789.svg
@@ -2,7 +2,7 @@
123456789
-
+
diff --git a/tests/verified-files/TypeInterleaved25-1234567890.svg b/tests/verified-files/TypeInterleaved25-1234567890.svg
index 77af1b4..3d0c1ed 100644
--- a/tests/verified-files/TypeInterleaved25-1234567890.svg
+++ b/tests/verified-files/TypeInterleaved25-1234567890.svg
@@ -2,7 +2,7 @@
AA1234567890ZA
-
+
diff --git a/tests/verified-files/TypeInterleaved25Checksum-1234567890.svg b/tests/verified-files/TypeInterleaved25Checksum-1234567890.svg
index 55f32b0..394bf7d 100644
--- a/tests/verified-files/TypeInterleaved25Checksum-1234567890.svg
+++ b/tests/verified-files/TypeInterleaved25Checksum-1234567890.svg
@@ -2,7 +2,7 @@
AA012345678905ZA
-
+
diff --git a/tests/verified-files/TypeKix-123456789.svg b/tests/verified-files/TypeKix-123456789.svg
index 0c05177..953a330 100644
--- a/tests/verified-files/TypeKix-123456789.svg
+++ b/tests/verified-files/TypeKix-123456789.svg
@@ -2,7 +2,7 @@
123456789
-
+
diff --git a/tests/verified-files/TypeMsi-123456789.svg b/tests/verified-files/TypeMsi-123456789.svg
index 89c0090..a48095e 100644
--- a/tests/verified-files/TypeMsi-123456789.svg
+++ b/tests/verified-files/TypeMsi-123456789.svg
@@ -2,7 +2,7 @@
123456789
-
+
diff --git a/tests/verified-files/TypeMsiChecksum-123456789.svg b/tests/verified-files/TypeMsiChecksum-123456789.svg
index de5eae8..6cd6062 100644
--- a/tests/verified-files/TypeMsiChecksum-123456789.svg
+++ b/tests/verified-files/TypeMsiChecksum-123456789.svg
@@ -2,7 +2,7 @@
1234567892
-
+
diff --git a/tests/verified-files/TypePharmacode-123456789.svg b/tests/verified-files/TypePharmacode-123456789.svg
index 46044b0..3dac6de 100644
--- a/tests/verified-files/TypePharmacode-123456789.svg
+++ b/tests/verified-files/TypePharmacode-123456789.svg
@@ -2,7 +2,7 @@
123456789
-
+
diff --git a/tests/verified-files/TypePharmacodeTwoCode-123456789.svg b/tests/verified-files/TypePharmacodeTwoCode-123456789.svg
index 39975d4..6a409d3 100644
--- a/tests/verified-files/TypePharmacodeTwoCode-123456789.svg
+++ b/tests/verified-files/TypePharmacodeTwoCode-123456789.svg
@@ -2,7 +2,7 @@
123456789
-
+
diff --git a/tests/verified-files/TypePlanet-123456789.svg b/tests/verified-files/TypePlanet-123456789.svg
index 51de3aa..a6a3fe8 100644
--- a/tests/verified-files/TypePlanet-123456789.svg
+++ b/tests/verified-files/TypePlanet-123456789.svg
@@ -2,7 +2,7 @@
123456789
-
+
diff --git a/tests/verified-files/TypePostnet-123456789.svg b/tests/verified-files/TypePostnet-123456789.svg
index ca895ec..5cefece 100644
--- a/tests/verified-files/TypePostnet-123456789.svg
+++ b/tests/verified-files/TypePostnet-123456789.svg
@@ -2,7 +2,7 @@
123456789
-
+
diff --git a/tests/verified-files/TypeRms4cc-123456789.svg b/tests/verified-files/TypeRms4cc-123456789.svg
index ee91be7..5e7c698 100644
--- a/tests/verified-files/TypeRms4cc-123456789.svg
+++ b/tests/verified-files/TypeRms4cc-123456789.svg
@@ -2,7 +2,7 @@
123456789
-
+
diff --git a/tests/verified-files/TypeStandard2of5-1234567890.svg b/tests/verified-files/TypeStandard2of5-1234567890.svg
index 26d48c5..8aee635 100644
--- a/tests/verified-files/TypeStandard2of5-1234567890.svg
+++ b/tests/verified-files/TypeStandard2of5-1234567890.svg
@@ -2,7 +2,7 @@
1234567890
-
+
diff --git a/tests/verified-files/TypeStandard2of5Checksum-1234567890.svg b/tests/verified-files/TypeStandard2of5Checksum-1234567890.svg
index dcdc32a..650cc9f 100644
--- a/tests/verified-files/TypeStandard2of5Checksum-1234567890.svg
+++ b/tests/verified-files/TypeStandard2of5Checksum-1234567890.svg
@@ -2,7 +2,7 @@
12345678905
-
+
diff --git a/tests/verified-files/TypeTelepen-1234567890ASCD.svg b/tests/verified-files/TypeTelepen-1234567890ASCD.svg
index d44f436..22429b2 100644
--- a/tests/verified-files/TypeTelepen-1234567890ASCD.svg
+++ b/tests/verified-files/TypeTelepen-1234567890ASCD.svg
@@ -2,7 +2,7 @@
1234567890ASCD
-
+
diff --git a/tests/verified-files/TypeTelepenNumeric-1234567890.svg b/tests/verified-files/TypeTelepenNumeric-1234567890.svg
index 079766b..34c4479 100644
--- a/tests/verified-files/TypeTelepenNumeric-1234567890.svg
+++ b/tests/verified-files/TypeTelepenNumeric-1234567890.svg
@@ -2,7 +2,7 @@
1234567890
-
+
diff --git a/tests/verified-files/TypeUpcA-123456789.svg b/tests/verified-files/TypeUpcA-123456789.svg
index d7ed6dc..38b420c 100644
--- a/tests/verified-files/TypeUpcA-123456789.svg
+++ b/tests/verified-files/TypeUpcA-123456789.svg
@@ -2,7 +2,7 @@
0001234567895
-
+
diff --git a/tests/verified-files/TypeUpcE-123456789.svg b/tests/verified-files/TypeUpcE-123456789.svg
index 4347e92..4333be7 100644
--- a/tests/verified-files/TypeUpcE-123456789.svg
+++ b/tests/verified-files/TypeUpcE-123456789.svg
@@ -2,7 +2,7 @@
012349
-
+
diff --git a/tests/verified-files/TypeUpcExtension2-22.svg b/tests/verified-files/TypeUpcExtension2-22.svg
index d7f285d..1fb84e7 100644
--- a/tests/verified-files/TypeUpcExtension2-22.svg
+++ b/tests/verified-files/TypeUpcExtension2-22.svg
@@ -2,7 +2,7 @@
22
-
+
diff --git a/tests/verified-files/TypeUpcExtension5-1234567890abcABC-283-33.svg b/tests/verified-files/TypeUpcExtension5-1234567890abcABC-283-33.svg
index df18eae..a4287a5 100644
--- a/tests/verified-files/TypeUpcExtension5-1234567890abcABC-283-33.svg
+++ b/tests/verified-files/TypeUpcExtension5-1234567890abcABC-283-33.svg
@@ -2,7 +2,7 @@
1234567890abcABC-283*33
-
+