summaryrefslogtreecommitdiff
path: root/macros/luatex/generic/barracuda/test/test-code39/001-code39-test.lua
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-12-05 03:00:50 +0000
committerNorbert Preining <norbert@preining.info>2019-12-05 03:00:50 +0000
commit2905ee4c8de47cfdeea4787e465eb827f9b99e8b (patch)
tree802c26d7002fd7e2188412b5bd1f86cd9ee2c4d6 /macros/luatex/generic/barracuda/test/test-code39/001-code39-test.lua
parent05ad7831f64aa0e2fc9eac63816eeafcb0b09708 (diff)
CTAN sync 201912050300
Diffstat (limited to 'macros/luatex/generic/barracuda/test/test-code39/001-code39-test.lua')
-rw-r--r--macros/luatex/generic/barracuda/test/test-code39/001-code39-test.lua41
1 files changed, 41 insertions, 0 deletions
diff --git a/macros/luatex/generic/barracuda/test/test-code39/001-code39-test.lua b/macros/luatex/generic/barracuda/test/test-code39/001-code39-test.lua
new file mode 100644
index 0000000000..e4a8569e93
--- /dev/null
+++ b/macros/luatex/generic/barracuda/test/test-code39/001-code39-test.lua
@@ -0,0 +1,41 @@
+-- Copyright (C) 2019 Roberto Giacomelli
+-- test Code 39 encoder
+
+local barracuda = require "barracuda"
+
+for k, v in pairs(barracuda) do
+ print(k,v)
+end
+
+local barcode = barracuda:get_barcode_class()
+
+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")
+for _, c in ipairs(symb.code) do
+ print(c)
+end
+print()
+
+local canvas = barracuda:new_canvas()
+symb:append_ga(canvas)
+
+-- native driver
+local drv = barracuda:get_driver()
+
+for _, code in ipairs(canvas._data) do print(code) end