diff options
Diffstat (limited to 'macros/luatex/generic/barracuda/test/test-code39/001-code39-test.tex')
-rw-r--r-- | macros/luatex/generic/barracuda/test/test-code39/001-code39-test.tex | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/macros/luatex/generic/barracuda/test/test-code39/001-code39-test.tex b/macros/luatex/generic/barracuda/test/test-code39/001-code39-test.tex new file mode 100644 index 0000000000..c08e1f242a --- /dev/null +++ b/macros/luatex/generic/barracuda/test/test-code39/001-code39-test.tex @@ -0,0 +1,39 @@ +% !TeX program = LuaTeX +% Copyright (C) 2019-2022 Roberto Giacomelli +% test Code 39 encoder + +\directlua{ +local barracuda = require "barracuda" + +for k, v in pairs(barracuda) do + print(k, v) +end + +local barcode = barracuda:barcode() + +local c39, err = barcode:new_encoder("code39") +assert(not err, err) + +print(c39._NAME) +print(c39._VERSION) + +local info = c39:info() + +print("encoder name = ", info.name) +print("description = ", info.description) +for k, tp in ipairs(info.param) do + print(k, tp.name, tp.value) +end + +local symb = c39:from_string("123") + +print("print internal representation of chars") +print(table.concat(symb:get_code(), " ")) +print("end") +assert(symb:get_hri() == nil) + +local canvas = barracuda:new_canvas() +symb:draw(canvas) +% canvas:prettyprint_ga() +} +\bye |