Skip to content

Commit 8aec97c

Browse files
committed
📦 Release v3.12.2
1 parent 835c47d commit 8aec97c

14 files changed

+45
-35
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,13 @@ Download or get the CDN link to the script:
135135

136136
| Name | Supported barcodes | Size (gzip) | CDN / Download |
137137
|------|--------------------|:-----------:|---------------:|
138-
| *All* | *All the barcodes!* | *11 kB* | *[JsBarcode.all.min.js][1]* |
139-
| CODE128 | CODE128 (auto and force mode) | 6.2 kB | [JsBarcode.code128.min.js][2] |
138+
| *All* | *All the barcodes!* | *11.1 kB* | *[JsBarcode.all.min.js][1]* |
139+
| CODE128 | CODE128 (auto and force mode) | 6.3 kB | [JsBarcode.code128.min.js][2] |
140140
| CODE39 | CODE39 | 5.1 kB | [JsBarcode.code39.min.js][3] |
141-
| EAN / UPC | EAN-13, EAN-8, EAN-5, EAN-2, UPC (A) | 6.6 kB | [JsBarcode.ean-upc.min.js][4] |
142-
| ITF | ITF, ITF-14 | 5 kB | [JsBarcode.itf.min.js][5] |
141+
| EAN / UPC | EAN-13, EAN-8, EAN-5, EAN-2, UPC (A) | 6.7 kB | [JsBarcode.ean-upc.min.js][4] |
142+
| ITF | ITF, ITF-14 | 5.1 kB | [JsBarcode.itf.min.js][5] |
143143
| MSI | MSI, MSI10, MSI11, MSI1010, MSI1110 | 5 kB | [JsBarcode.msi.min.js][6] |
144-
| Pharmacode | Pharmacode | 4.7 kB | [JsBarcode.pharmacode.min.js][7] |
144+
| Pharmacode | Pharmacode | 4.8 kB | [JsBarcode.pharmacode.min.js][7] |
145145
| Codabar | Codabar | 4.9 kB | [JsBarcode.codabar.min.js][8] |
146146
| CODE93 | CODE93 | | JsBarcode.code93.min.js |
147147

bin/renderers/svg.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ var SVGRenderer = function () {
6464
this.setSvgAttributes(width, maxHeight);
6565

6666
if (this.options.background) {
67-
this.drawRect(0, 0, width, maxHeight, this.svg).setAttribute("style", "fill:" + this.options.background + ";");
67+
this.drawRect(0, 0, width, maxHeight, this.svg).setAttribute("fill", this.options.background);
6868
}
6969
}
7070
}, {
@@ -107,7 +107,14 @@ var SVGRenderer = function () {
107107
if (options.displayValue) {
108108
var x, y;
109109

110-
textElem.setAttribute("style", "font:" + options.fontOptions + " " + options.fontSize + "px " + options.font);
110+
textElem.setAttribute("font-family", options.font);
111+
textElem.setAttribute("font-size", options.fontSize);
112+
if (options.fontOptions.includes("bold")) {
113+
textElem.setAttribute("font-weight", "bold");
114+
}
115+
if (options.fontOptions.includes("italic")) {
116+
textElem.setAttribute("font-style", "italic");
117+
}
111118

112119
if (options.textPosition == "top") {
113120
y = options.fontSize - options.textMargin;
@@ -149,8 +156,6 @@ var SVGRenderer = function () {
149156

150157
svg.setAttribute("xmlns", svgns);
151158
svg.setAttribute("version", "1.1");
152-
153-
svg.setAttribute("style", "transform: translate(0,0)");
154159
}
155160
}, {
156161
key: "createGroup",
@@ -165,7 +170,7 @@ var SVGRenderer = function () {
165170
}, {
166171
key: "setGroupOptions",
167172
value: function setGroupOptions(group, options) {
168-
group.setAttribute("style", "fill:" + options.lineColor + ";");
173+
group.setAttribute("fill", options.lineColor);
169174
}
170175
}, {
171176
key: "drawRect",

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "JsBarcode",
33
"main": "dist/JsBarcode.all.min.js",
4-
"version": "3.12.1",
4+
"version": "3.12.2",
55
"homepage": "https://github.com/lindell/JsBarcode",
66
"authors": [
77
"Johan Lindell <johan@lindell.me>"

dist/JsBarcode.all.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3674,7 +3674,7 @@ var SVGRenderer = function () {
36743674
this.setSvgAttributes(width, maxHeight);
36753675

36763676
if (this.options.background) {
3677-
this.drawRect(0, 0, width, maxHeight, this.svg).setAttribute("style", "fill:" + this.options.background + ";");
3677+
this.drawRect(0, 0, width, maxHeight, this.svg).setAttribute("fill", this.options.background);
36783678
}
36793679
}
36803680
}, {
@@ -3717,7 +3717,14 @@ var SVGRenderer = function () {
37173717
if (options.displayValue) {
37183718
var x, y;
37193719

3720-
textElem.setAttribute("style", "font:" + options.fontOptions + " " + options.fontSize + "px " + options.font);
3720+
textElem.setAttribute("font-family", options.font);
3721+
textElem.setAttribute("font-size", options.fontSize);
3722+
if (options.fontOptions.includes("bold")) {
3723+
textElem.setAttribute("font-weight", "bold");
3724+
}
3725+
if (options.fontOptions.includes("italic")) {
3726+
textElem.setAttribute("font-style", "italic");
3727+
}
37213728

37223729
if (options.textPosition == "top") {
37233730
y = options.fontSize - options.textMargin;
@@ -3759,8 +3766,6 @@ var SVGRenderer = function () {
37593766

37603767
svg.setAttribute("xmlns", svgns);
37613768
svg.setAttribute("version", "1.1");
3762-
3763-
svg.setAttribute("style", "transform: translate(0,0)");
37643769
}
37653770
}, {
37663771
key: "createGroup",
@@ -3775,7 +3780,7 @@ var SVGRenderer = function () {
37753780
}, {
37763781
key: "setGroupOptions",
37773782
value: function setGroupOptions(group, options) {
3778-
group.setAttribute("style", "fill:" + options.lineColor + ";");
3783+
group.setAttribute("fill", options.lineColor);
37793784
}
37803785
}, {
37813786
key: "drawRect",

dist/JsBarcode.all.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/barcodes/JsBarcode.codabar.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/barcodes/JsBarcode.code128.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/barcodes/JsBarcode.code39.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/barcodes/JsBarcode.code93.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/barcodes/JsBarcode.ean-upc.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)