summaryrefslogtreecommitdiff
path: root/macros/luatex/generic/barracuda/test/test-code39/007-code39-test.tex
blob: 5090e54058313105923e2931af4c1171c2e4e01a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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