summaryrefslogtreecommitdiff
path: root/macros/luatex/generic/barracuda/barracuda.sty
diff options
context:
space:
mode:
Diffstat (limited to 'macros/luatex/generic/barracuda/barracuda.sty')
-rw-r--r--macros/luatex/generic/barracuda/barracuda.sty21
1 files changed, 21 insertions, 0 deletions
diff --git a/macros/luatex/generic/barracuda/barracuda.sty b/macros/luatex/generic/barracuda/barracuda.sty
new file mode 100644
index 0000000000..7ee6b02104
--- /dev/null
+++ b/macros/luatex/generic/barracuda/barracuda.sty
@@ -0,0 +1,21 @@
+%
+\NeedsTeXFormat{LaTeX2e}[2009/06/27]
+\ProvidesPackage{barracuda}[2018/12/30 v0.1 a barcode typesetting package]%
+
+\newbox\barracudabox
+\newcommand\barracuda[2]{\directlua{
+ local barracuda = require "barracuda"
+ local e = [[#1]]
+ local s = [[#2]]
+ local enc, err = barracuda:get_barcode_class():new_encoder(e)
+ assert(enc, err)
+ local symb, err = enc:from_string(s); assert(symb, err)
+ local canvas = barracuda:new_canvas()
+ symb:append_ga(canvas)
+ local drv = barracuda:get_driver()
+ drv:ga_to_hbox(canvas, "barracudabox")
+}%
+\box\barracudabox
+}
+
+\endinput