blob: 52784b66bbc760f138166c750cc8135b92151872 (
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
% !TeX program = LuaTeX
% Copyright (C) 2020 Roberto Giacomelli
\newbox\mybox
\nopagenumbers
\directlua{barracuda = require "barracuda"}
Test 2: Interleaved 2 of 5 encoder test for ITF14 variant.
\directlua{
local barcode = barracuda:barcode()
local enc = assert(barcode:new_encoder("i2of5-ITF14"))
local s1 = assert(enc:from_uint(1234567890123))
local canvas = barracuda:new_canvas()
s1:append_ga(canvas)
local drv = barracuda:get_driver()
drv:ga_to_hbox(canvas, "mybox")
}
\vskip 10pt
12345678901231 is \vrule A\vrule\box\mybox \vrule A\vrule
\directlua{
local barcode = barracuda:barcode()
local enc = assert(barcode:enc_by_name("i2of5-ITF14"))
local s1 = assert(enc:from_string("1234567890123"))
local canvas = barracuda:new_canvas()
s1:append_ga(canvas)
local drv = barracuda:get_driver()
drv:ga_to_hbox(canvas, "mybox")
}
\vskip 10pt
12345678901231 is \vrule A\vrule\box\mybox \vrule A\vrule
\directlua{
local barcode = barracuda:barcode()
local enc = assert(barcode:enc_by_name("i2of5-ITF14"))
local s1 = assert(enc:from_string("(12) 34 56 78 90 12 3"))
local canvas = barracuda:new_canvas()
s1:append_ga(canvas)
local drv = barracuda:get_driver()
drv:ga_to_hbox(canvas, "mybox")
}
\vskip 10pt
12345678901231 is \vrule A\vrule\box\mybox \vrule A\vrule
\bye
|