diff options
Diffstat (limited to 'macros/luatex/generic/barracuda/test/test-code39/007-code39-test.tex')
-rw-r--r-- | macros/luatex/generic/barracuda/test/test-code39/007-code39-test.tex | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/macros/luatex/generic/barracuda/test/test-code39/007-code39-test.tex b/macros/luatex/generic/barracuda/test/test-code39/007-code39-test.tex new file mode 100644 index 0000000000..5090e54058 --- /dev/null +++ b/macros/luatex/generic/barracuda/test/test-code39/007-code39-test.tex @@ -0,0 +1,39 @@ +% !TeX program = LuaTeX +% Copyright (C) 2019-2022 Roberto Giacomelli + +\newbox\mybox +\nopagenumbers + +\directlua{ +barracuda = require "barracuda" +local c39 = assert( + barracuda:barcode() + :new_encoder("code39", {debug_bbox_on = true}) +) + +local bars = c39:new { + 123456, + "123456", + "ABCDEF", + 87429, + 982398, + "HDUHBE" +} + +local canvas = barracuda:new_canvas() +local tx, ty = 0, 0 +local dh = tex.sp "40pt" +for _, b in ipairs(bars) do + b:draw(canvas, tx, ty) + ty = ty + dh +end + +local drv = barracuda:get_driver() +drv:ga_to_hbox(canvas, "mybox") +} + +Test 1: check Barcode recursive costructor new(): +\bigskip +\leavevmode\box\mybox +\bye + |