summaryrefslogtreecommitdiff
path: root/macros/luatex/generic/barracuda/test/test-i2of5
diff options
context:
space:
mode:
Diffstat (limited to 'macros/luatex/generic/barracuda/test/test-i2of5')
-rw-r--r--macros/luatex/generic/barracuda/test/test-i2of5/001-i2of5-test.pdfbin19136 -> 20158 bytes
-rw-r--r--macros/luatex/generic/barracuda/test/test-i2of5/001-i2of5-test.tex59
-rw-r--r--macros/luatex/generic/barracuda/test/test-i2of5/002-ITF14-test.pdfbin16052 -> 16541 bytes
-rw-r--r--macros/luatex/generic/barracuda/test/test-i2of5/002-ITF14-test.tex23
-rw-r--r--macros/luatex/generic/barracuda/test/test-i2of5/02-itf14.svg76
5 files changed, 116 insertions, 42 deletions
diff --git a/macros/luatex/generic/barracuda/test/test-i2of5/001-i2of5-test.pdf b/macros/luatex/generic/barracuda/test/test-i2of5/001-i2of5-test.pdf
index f2dbd6f9ea..5bf43e574b 100644
--- a/macros/luatex/generic/barracuda/test/test-i2of5/001-i2of5-test.pdf
+++ b/macros/luatex/generic/barracuda/test/test-i2of5/001-i2of5-test.pdf
Binary files differ
diff --git a/macros/luatex/generic/barracuda/test/test-i2of5/001-i2of5-test.tex b/macros/luatex/generic/barracuda/test/test-i2of5/001-i2of5-test.tex
index 0062b74d3e..3f5a4dff75 100644
--- a/macros/luatex/generic/barracuda/test/test-i2of5/001-i2of5-test.tex
+++ b/macros/luatex/generic/barracuda/test/test-i2of5/001-i2of5-test.tex
@@ -1,10 +1,14 @@
% !TeX program = LuaTeX
-% Copyright (C) 2020 Roberto Giacomelli
+% Copyright (C) 2019-2022 Roberto Giacomelli
\newbox\mybox
\nopagenumbers
-\directlua{barracuda = require "barracuda"}
+\directlua{
+barracuda = require "barracuda"
+local barcode = barracuda:barcode()
+barcode:set_param("debug_bbox", "symb")
+}
Interleaved 2 of 5 encoder test.
@@ -12,14 +16,13 @@ Test 1: one simple barcode with default parameters:
\directlua{
local barcode = barracuda:barcode()
-
local enc, err = barcode:new_encoder("i2of5"); assert(not err, err)
local symbo, err = enc:from_uint(54654681); assert(not err, err)
-local canvas = barracuda:new_canvas(); symbo:append_ga(canvas)
+local canvas = barracuda:new_canvas(); symbo:draw(canvas)
local drv = barracuda:get_driver()
drv:ga_to_hbox(canvas, "mybox")
-}
-\vrule A\vrule\box\mybox \vrule A\vrule
+}%
+input code 54654681: \vrule A\vrule\box\mybox \vrule A\vrule
\bigskip
Test 2: one simple barcode with default parameter:
@@ -28,11 +31,11 @@ Test 2: one simple barcode with default parameter:
local barcode = barracuda:barcode()
local enc, err = barcode:enc_by_name("i2of5"); assert(not err, err)
local symbo, err = enc:from_uint(1234567895); assert(not err, err)
-local canvas = barracuda:new_canvas(); symbo:append_ga(canvas)
+local canvas = barracuda:new_canvas(); symbo:draw(canvas)
local drv = barracuda:get_driver()
drv:ga_to_hbox(canvas, "mybox")
-}
-\vrule A\vrule\box\mybox \vrule A\vrule
+}%
+input code 1234567895: \vrule A\vrule\box\mybox \vrule A\vrule
% check digit tests
@@ -104,11 +107,11 @@ local barcode = barracuda:barcode()
local enc, err = barcode:enc_by_name("i2of5"); assert(not err, err)
local symbo, err = enc:from_uint(454473, {check_digit_policy="add"})
assert(not err, err)
-local canvas = barracuda:new_canvas(); symbo:append_ga(canvas)
+local canvas = barracuda:new_canvas(); symbo:draw(canvas)
local drv = barracuda:get_driver()
drv:ga_to_hbox(canvas, "mybox")
-}
-\vrule A\vrule\box\mybox \vrule A\vrule
+}%
+input code 454473: \vrule A\vrule\box\mybox \vrule A\vrule
\bigskip
Test 4: a second simple barcode with check digit automatically added:
@@ -118,11 +121,11 @@ local barcode = barracuda:barcode()
local enc, err = barcode:enc_by_name("i2of5"); assert(not err, err)
local symbo, err = enc:from_uint(74223, {check_digit_policy="add"})
assert(not err, err)
-local canvas = barracuda:new_canvas(); symbo:append_ga(canvas)
+local canvas = barracuda:new_canvas(); symbo:draw(canvas)
local drv = barracuda:get_driver()
drv:ga_to_hbox(canvas, "mybox")
-}
-\vrule A\vrule\box\mybox \vrule A\vrule
+}%
+input code 74223: \vrule A\vrule\box\mybox \vrule A\vrule
\bigskip
Test 5: a symbol with native check digits:
@@ -132,11 +135,11 @@ local barcode = barracuda:barcode()
local enc, err = barcode:enc_by_name("i2of5"); assert(not err, err)
local symbo, err = enc:from_uint(121891259, {check_digit_policy="verify"})
assert(not err, err)
-local canvas = barracuda:new_canvas(); symbo:append_ga(canvas)
+local canvas = barracuda:new_canvas(); symbo:draw(canvas)
local drv = barracuda:get_driver()
drv:ga_to_hbox(canvas, "mybox")
-}
-\vrule A\vrule\box\mybox \vrule A\vrule
+}%
+input code 121891259: \vrule A\vrule\box\mybox \vrule A\vrule
\bigskip
Test 6: bearer bars please:
@@ -144,13 +147,13 @@ Test 6: bearer bars please:
\directlua{
local barcode = barracuda:barcode()
local enc, err = barcode:enc_by_name("i2of5"); assert(not err, err)
-local symbo, err = enc:from_uint(747867239, {bearer_bars_enabled = true})
+local symbo, err = enc:from_string("747867239", {bearer_bars_enabled = true})
assert(not err, err)
-local canvas = barracuda:new_canvas(); symbo:append_ga(canvas)
+local canvas = barracuda:new_canvas(); symbo:draw(canvas)
local drv = barracuda:get_driver()
drv:ga_to_hbox(canvas, "mybox")
-}
-\vrule A\vrule\box\mybox \vrule A\vrule
+}%
+input string "747867239": \vrule A\vrule\box\mybox \vrule A\vrule
\bigskip
Test 7: bearer bars all around the symbol:
@@ -160,11 +163,11 @@ local barcode = barracuda:barcode()
local enc, err = barcode:enc_by_name("i2of5"); assert(not err, err)
local symbo, err = enc:from_uint(986790868, {bearer_bars_enabled = true, bearer_bars_layout="frame"})
assert(not err, err)
-local canvas = barracuda:new_canvas(); symbo:append_ga(canvas)
+local canvas = barracuda:new_canvas(); symbo:draw(canvas)
local drv = barracuda:get_driver()
drv:ga_to_hbox(canvas, "mybox")
-}
-\vrule A\vrule\box\mybox \vrule A\vrule
+}%
+input code 986790868: \vrule A\vrule\box\mybox \vrule A\vrule
\bigskip
Test 8: bearer bars all around the symbol (with string costructor):
@@ -174,11 +177,11 @@ local barcode = barracuda:barcode()
local enc, err = barcode:enc_by_name("i2of5"); assert(not err, err)
local symbo, err = enc:from_string("986790868", {bearer_bars_enabled = true, bearer_bars_layout="frame"})
assert(not err, err)
-local canvas = barracuda:new_canvas(); symbo:append_ga(canvas)
+local canvas = barracuda:new_canvas(); symbo:draw(canvas)
local drv = barracuda:get_driver()
drv:ga_to_hbox(canvas, "mybox")
-}
-\vrule A\vrule\box\mybox \vrule A\vrule
+}%
+input string "986790868": \vrule A\vrule\box\mybox \vrule A\vrule
That's all folks!
diff --git a/macros/luatex/generic/barracuda/test/test-i2of5/002-ITF14-test.pdf b/macros/luatex/generic/barracuda/test/test-i2of5/002-ITF14-test.pdf
index 79a05eca42..449a7b63a8 100644
--- a/macros/luatex/generic/barracuda/test/test-i2of5/002-ITF14-test.pdf
+++ b/macros/luatex/generic/barracuda/test/test-i2of5/002-ITF14-test.pdf
Binary files differ
diff --git a/macros/luatex/generic/barracuda/test/test-i2of5/002-ITF14-test.tex b/macros/luatex/generic/barracuda/test/test-i2of5/002-ITF14-test.tex
index 52784b66bb..7b6229b483 100644
--- a/macros/luatex/generic/barracuda/test/test-i2of5/002-ITF14-test.tex
+++ b/macros/luatex/generic/barracuda/test/test-i2of5/002-ITF14-test.tex
@@ -1,5 +1,5 @@
% !TeX program = LuaTeX
-% Copyright (C) 2020 Roberto Giacomelli
+% Copyright (C) 2019-2022 Roberto Giacomelli
\newbox\mybox
\nopagenumbers
@@ -15,9 +15,8 @@ local enc = assert(barcode:new_encoder("i2of5-ITF14"))
local s1 = assert(enc:from_uint(1234567890123))
local canvas = barracuda:new_canvas()
-s1:append_ga(canvas)
-local drv = barracuda:get_driver()
-drv:ga_to_hbox(canvas, "mybox")
+s1:draw(canvas)
+canvas:ga_to_hbox("mybox")
}
\vskip 10pt
12345678901231 is \vrule A\vrule\box\mybox \vrule A\vrule
@@ -28,9 +27,8 @@ local enc = assert(barcode:enc_by_name("i2of5-ITF14"))
local s1 = assert(enc:from_string("1234567890123"))
local canvas = barracuda:new_canvas()
-s1:append_ga(canvas)
-local drv = barracuda:get_driver()
-drv:ga_to_hbox(canvas, "mybox")
+s1:draw(canvas)
+canvas:ga_to_hbox("mybox")
}
\vskip 10pt
12345678901231 is \vrule A\vrule\box\mybox \vrule A\vrule
@@ -39,15 +37,12 @@ drv:ga_to_hbox(canvas, "mybox")
local barcode = barracuda:barcode()
local enc = assert(barcode:enc_by_name("i2of5-ITF14"))
local s1 = assert(enc:from_string("(12) 34 56 78 90 12 3"))
-
+s1:set_param("debug_bbox_on", true)
local canvas = barracuda:new_canvas()
-s1:append_ga(canvas)
-local drv = barracuda:get_driver()
-drv:ga_to_hbox(canvas, "mybox")
+s1:draw(canvas)
+canvas:ga_to_hbox("mybox")
+canvas:save("svg", "02-itf14")
}
\vskip 10pt
12345678901231 is \vrule A\vrule\box\mybox \vrule A\vrule
-
\bye
-
-
diff --git a/macros/luatex/generic/barracuda/test/test-i2of5/02-itf14.svg b/macros/luatex/generic/barracuda/test/test-i2of5/02-itf14.svg
new file mode 100644
index 0000000000..2f8ee06996
--- /dev/null
+++ b/macros/luatex/generic/barracuda/test/test-i2of5/02-itf14.svg
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Barracuda package (https://github.com/robitex/barracuda) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg"
+ version="1.1"
+ width="74.497108mm" height="20.349904mm"
+ viewBox="-7.424961 -15.174920 74.497108 20.349904"
+>
+ <g stroke="black">
+ <path d="M0.247499 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ <path d="M1.237493 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ </g>
+ <g stroke="black">
+ <path d="M2.598736 -12.699933V-0.000000" style="stroke-width:1.237493"/>
+ <path d="M3.959979 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ <path d="M5.692470 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ <path d="M6.682465 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ <path d="M8.043708 -12.699933V-0.000000" style="stroke-width:1.237493"/>
+ </g>
+ <g stroke="black">
+ <path d="M10.518695 -12.699933V-0.000000" style="stroke-width:1.237493"/>
+ <path d="M12.251186 -12.699933V-0.000000" style="stroke-width:1.237493"/>
+ <path d="M13.612428 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ <path d="M15.344919 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ <path d="M16.334914 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ </g>
+ <g stroke="black">
+ <path d="M18.438653 -12.699933V-0.000000" style="stroke-width:1.237493"/>
+ <path d="M19.799896 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ <path d="M21.903635 -12.699933V-0.000000" style="stroke-width:1.237493"/>
+ <path d="M24.007374 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ <path d="M24.997368 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ </g>
+ <g stroke="black">
+ <path d="M25.987363 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ <path d="M27.719854 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ <path d="M28.709849 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ <path d="M30.071092 -12.699933V-0.000000" style="stroke-width:1.237493"/>
+ <path d="M32.546079 -12.699933V-0.000000" style="stroke-width:1.237493"/>
+ </g>
+ <g stroke="black">
+ <path d="M33.907322 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ <path d="M35.268564 -12.699933V-0.000000" style="stroke-width:1.237493"/>
+ <path d="M36.629807 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ <path d="M38.733546 -12.699933V-0.000000" style="stroke-width:1.237493"/>
+ <path d="M40.837285 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ </g>
+ <g stroke="black">
+ <path d="M42.198528 -12.699933V-0.000000" style="stroke-width:1.237493"/>
+ <path d="M43.559771 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ <path d="M45.292262 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ <path d="M46.282256 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ <path d="M47.643499 -12.699933V-0.000000" style="stroke-width:1.237493"/>
+ </g>
+ <g stroke="black">
+ <path d="M50.118486 -12.699933V-0.000000" style="stroke-width:1.237493"/>
+ <path d="M52.593473 -12.699933V-0.000000" style="stroke-width:1.237493"/>
+ <path d="M53.954716 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ <path d="M54.944711 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ <path d="M55.934706 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ </g>
+ <g stroke="black">
+ <path d="M58.038445 -12.699933V-0.000000" style="stroke-width:1.237493"/>
+ <path d="M59.399687 -12.699933V-0.000000" style="stroke-width:0.494997"/>
+ </g>
+ <rect x="-6.187467" y="-13.937427" width="72.022121" height="15.174920" fill="none" stroke="black" stroke-width="2.474987"
+ />
+ <text x="29.823593" y="5.174984" font-family="Verdana" font-size="2.877000" text-anchor="middle">
+ (12) 34 56 78 90 12 31 </text>
+ <rect x="-7.407322" y="-15.157281" width="74.461830" height="17.614629" fill="none" stroke="black" stroke-width="0.035278"
+ stroke-dasharray="2.116667 1.058333"
+ stroke-dashoffset="1.058333"
+ />
+</svg>
+