summaryrefslogtreecommitdiff
path: root/macros/luatex/generic/barracuda/test/test-code39/002-code39-test.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/luatex/generic/barracuda/test/test-code39/002-code39-test.tex')
-rw-r--r--macros/luatex/generic/barracuda/test/test-code39/002-code39-test.tex35
1 files changed, 19 insertions, 16 deletions
diff --git a/macros/luatex/generic/barracuda/test/test-code39/002-code39-test.tex b/macros/luatex/generic/barracuda/test/test-code39/002-code39-test.tex
index eb1693b5ba..f242fafa4d 100644
--- a/macros/luatex/generic/barracuda/test/test-code39/002-code39-test.tex
+++ b/macros/luatex/generic/barracuda/test/test-code39/002-code39-test.tex
@@ -1,5 +1,5 @@
% !TeX program = LuaTeX
-% Copyright (C) 2020 Roberto Giacomelli
+% Copyright (C) 2019-2022 Roberto Giacomelli
\newbox\mybox
\nopagenumbers
@@ -19,10 +19,10 @@ local symbol, err = c39:from_string("ABC12QJ31")
assert(not err, err)
local canvas = barracuda:new_canvas()
-symbol:append_ga(canvas)
+symbol:draw(canvas)
local drv = barracuda:get_driver()
drv:ga_to_hbox(canvas, "mybox")
-}\box\mybox
+}\leavevmode\box\mybox
Test 2: get the reference of the previous encoder and typeset two
Code 39 symbols on the same canvas, one above to the other:
@@ -36,13 +36,13 @@ local s1, err = c39:from_string("ZKPQJ31"); assert(s1, err)
local s2, err = c39:from_string("RTFG746", {text_vpos="top"}); assert(s2, err)
local canvas = barracuda:new_canvas()
-s1:append_ga(canvas)
+s1:draw(canvas)
local h2 = s2:get_param("height")
-s2:append_ga(canvas, 0.0, h2 + tex.sp "5pt")
+s2:draw(canvas, 0.0, h2 + tex.sp "5pt")
local drv = barracuda:get_driver()
drv:ga_to_hbox(canvas, "mybox")
-}\box\mybox
+}\leavevmode\box\mybox
Test 3: with the same encoder print a symbol, change globally the height,
and reprint the same symbol again on the same canvas:
@@ -55,17 +55,17 @@ assert(c39, err)
local s1, err = c39:from_string("ZKPQJ31"); assert(s1, err)
local canvas = barracuda:new_canvas()
-s1:append_ga(canvas)
+s1:draw(canvas)
local h = s1:get_param("height")
c39:set_param("height", 2*h)
c39:set_param {text_vpos = "top"}
-s1:append_ga(canvas, 0.0, h + tex.sp "5pt")
+s1:draw(canvas, 0.0, h + tex.sp "5pt")
local drv = barracuda:get_driver()
drv:ga_to_hbox(canvas, "mybox")
-}\box\mybox
+}\leavevmode\box\mybox
Test 4: do the same in test 3 but change locally parameters as
height and text properties:
@@ -78,7 +78,7 @@ assert(c39, err)
local s1, err = c39:from_string("0123456789"); assert(s1, err)
local canvas = barracuda:new_canvas()
-s1:append_ga(canvas)
+s1:draw(canvas)
local h, err = s1:get_param("height"); assert(h, err)
local ok, err = s1:set_param{
height = h/2,
@@ -88,27 +88,30 @@ local ok, err = s1:set_param{
text_star = true,
ay = 1,
}; assert(ok, err)
-s1:append_ga(canvas, 0.0, - tex.sp "5pt")
+s1:draw(canvas, 0.0, - tex.sp "5pt")
local drv = barracuda:get_driver()
drv:ga_to_hbox(canvas, "mybox")
-}\box\mybox
+}\leavevmode\box\mybox
-Test 5: create a new encoder with a large module value:
+Test 5: create a new encoder with a large module value.
+It's also activeted the debug\_bbox\_on option.
+
+\bigskip
\directlua{
local barcode = barracuda:barcode()
-local c39, err = barcode:new_encoder("code39:e2", {module = tex.sp "0.5mm"})
+local c39, err = barcode:new_encoder("code39:e2", {module = tex.sp "0.5mm", debug_bbox_on = true})
assert(c39, err)
local s1, err = c39:from_string("02040608"); assert(s1, err)
local canvas = barracuda:new_canvas()
-s1:append_ga(canvas)
+s1:draw(canvas)
local drv = barracuda:get_driver()
drv:ga_to_hbox(canvas, "mybox")
-}\box\mybox
+}\leavevmode\box\mybox
\bye