forked from metafloor/bwip-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaztecrune.js
196 lines (196 loc) · 7.42 KB
/
aztecrune.js
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
// file: bwipp/aztecrune.js
//
// This code was automatically generated from:
// Barcode Writer in Pure PostScript - Version 2015-08-10
//
// Copyright (c) 2011-2015 Mark Warren
// Copyright (c) 2004-2014 Terry Burton
//
// See the LICENSE file in the bwip-js root directory
// for the extended copyright notice.
// BEGIN aztecrune
if (!BWIPJS.bwipp["raiseerror"] && BWIPJS.increfs("aztecrune", "raiseerror")) {
BWIPJS.load("bwipp/raiseerror.js");
}
if (!BWIPJS.bwipp["renmatrix"] && BWIPJS.increfs("aztecrune", "renmatrix")) {
BWIPJS.load("bwipp/renmatrix.js");
}
if (!BWIPJS.bwipp["azteccode"] && BWIPJS.increfs("aztecrune", "azteccode")) {
BWIPJS.load("bwipp/azteccode.js");
}
BWIPJS.bwipp["aztecrune"]=function() {
function $f0(){
return -1;
}
function $f1(){
var t=this.stk[this.ptr-2]; this.stk[this.ptr-2]=this.stk[this.ptr-1]; this.stk[this.ptr-1]=t;
this.ptr--;
var t=this.stk[this.ptr-2]; this.stk[this.ptr-2]=this.stk[this.ptr-1]; this.stk[this.ptr-1]=t;
this.dict[this.stk[this.ptr-2]]=this.stk[this.ptr-1]; this.ptr-=2;
}
function $f2(){
this.stk[this.ptr++]=true;
this.dict[this.stk[this.ptr-2]]=this.stk[this.ptr-1]; this.ptr-=2;
}
function $f3(){
var a=/^\s*([^\s]+)(\s+.*)?$/.exec(this.stk[this.ptr-1]);
if (a) {
this.stk[this.ptr-1]=BWIPJS.psstring(a[2]===undefined?"":a[2]);
this.stk[this.ptr++]=BWIPJS.psstring(a[1]);
this.stk[this.ptr++]=true;
} else {
this.stk[this.ptr-1]=false;
}
this.stk[this.ptr++]=false;
if (this.stk[this.ptr-2] instanceof BWIPJS.psstring)
this.stk[this.ptr-2]=this.stk[this.ptr-2].toString()==this.stk[this.ptr-1];
else this.stk[this.ptr-2]=this.stk[this.ptr-2]==this.stk[this.ptr-1];
this.ptr--;
this.stk[this.ptr++]=$f0;
var t0=this.stk[--this.ptr];
if (this.stk[--this.ptr]) {
if (t0.call(this)==-1) return -1;
}
this.stk[this.ptr]=this.stk[this.ptr-1]; this.ptr++;
if (typeof(this.stk[this.ptr-1].length)!=="number") throw "length: invalid: " + BWIPJS.pstype(this.stk[this.ptr-1]);
this.stk[this.ptr-1]=this.stk[this.ptr-1].length;
this.stk[this.ptr-1]=BWIPJS.psstring(this.stk[this.ptr-1]);
var t=this.stk[this.ptr-2].toString();
this.stk[this.ptr-1].assign(0,t);
this.stk[this.ptr-2]=this.stk[this.ptr-1].subset(0,t.length);
this.ptr--;
this.stk[this.ptr++]=BWIPJS.psstring("=");
var h=this.stk[this.ptr-2];
var t=h.indexOf(this.stk[this.ptr-1]);
if (t==-1) {
this.stk[this.ptr-1]=false;
} else {
this.stk[this.ptr-2]=h.subset(t+this.stk[this.ptr-1].length);
this.stk[this.ptr-1]=h.subset(t,this.stk[this.ptr-1].length);
this.stk[this.ptr++]=h.subset(0,t);
this.stk[this.ptr++]=true;
}
this.stk[this.ptr++]=true;
if (this.stk[this.ptr-2] instanceof BWIPJS.psstring)
this.stk[this.ptr-2]=this.stk[this.ptr-2].toString()==this.stk[this.ptr-1];
else this.stk[this.ptr-2]=this.stk[this.ptr-2]==this.stk[this.ptr-1];
this.ptr--;
this.stk[this.ptr++]=$f1;
this.stk[this.ptr++]=$f2;
var t1=this.stk[--this.ptr];
var t2=this.stk[--this.ptr];
if (this.stk[--this.ptr]) {
if (t2.call(this)==-1) return -1;
} else {
if (t1.call(this)==-1) return -1;
}
}
function $f4(){
this.stk[this.ptr++]=1;
this.stk[this.ptr-1]={};
this.dict=this.stk[--this.ptr]; this.dstk.push(this.dict);
var t=this.dstk.get("options");
if (t instanceof Function) t.call(this); else this.stk[this.ptr++]=t;
this.stk[this.ptr++]=$f3;
var t3=this.stk[--this.ptr];
while (true) {
if (t3.call(this)==-1) break;
}
this.stk[this.ptr++]=this.dict;
this.dstk.pop(); this.dict=this.dstk[this.dstk.length-1];
this.stk[this.ptr++]="options";
var t=this.stk[this.ptr-2]; this.stk[this.ptr-2]=this.stk[this.ptr-1]; this.stk[this.ptr-1]=t;
this.dict[this.stk[this.ptr-2]]=this.stk[this.ptr-1]; this.ptr-=2;
}
function $f5(){
this.dict[this.stk[this.ptr-2]]=this.stk[this.ptr-1]; this.ptr-=2;
}
this.stk[this.ptr++]=20;
this.stk[this.ptr-1]={};
this.dict=this.stk[--this.ptr]; this.dstk.push(this.dict);
this.stk[this.ptr++]="options";
var t=this.stk[this.ptr-2]; this.stk[this.ptr-2]=this.stk[this.ptr-1]; this.stk[this.ptr-1]=t;
this.dict[this.stk[this.ptr-2]]=this.stk[this.ptr-1]; this.ptr-=2;
this.stk[this.ptr++]="barcode";
var t=this.stk[this.ptr-2]; this.stk[this.ptr-2]=this.stk[this.ptr-1]; this.stk[this.ptr-1]=t;
this.dict[this.stk[this.ptr-2]]=this.stk[this.ptr-1]; this.ptr-=2;
this.stk[this.ptr++]="dontdraw";
this.stk[this.ptr++]=false;
this.dict[this.stk[this.ptr-2]]=this.stk[this.ptr-1]; this.ptr-=2;
var t=this.dstk.get("options");
if (t instanceof Function) t.call(this); else this.stk[this.ptr++]=t;
this.stk[this.ptr-1]=BWIPJS.pstype(this.stk[this.ptr-1]);
this.stk[this.ptr++]="stringtype";
if (this.stk[this.ptr-2] instanceof BWIPJS.psstring)
this.stk[this.ptr-2]=this.stk[this.ptr-2].toString()==this.stk[this.ptr-1];
else this.stk[this.ptr-2]=this.stk[this.ptr-2]==this.stk[this.ptr-1];
this.ptr--;
this.stk[this.ptr++]=$f4;
var t4=this.stk[--this.ptr];
if (this.stk[--this.ptr]) {
if (t4.call(this)==-1) return -1;
}
var t=this.dstk.get("options");
if (t instanceof Function) t.call(this); else this.stk[this.ptr++]=t;
this.stk[this.ptr++]=$f5;
var t7=this.stk[--this.ptr];//forall
var t6=this.stk[--this.ptr];
for (var t5 in t6) {
if (t6 instanceof BWIPJS.psstring || t6 instanceof BWIPJS.psarray) {
if (t5.charCodeAt(0) > 57) continue;
} else {
if (t5.charCodeAt(0) == 0xffff) {
this.stk[this.ptr++]=+t5.substr(1);
} else {
this.stk[this.ptr++]=t5;
}
}
this.stk[this.ptr++]=BWIPJS.get(t6,t5);
if (t7.call(this)==-1) break;
}
var t=this.dstk.get("options");
if (t instanceof Function) t.call(this); else this.stk[this.ptr++]=t;
this.stk[this.ptr++]=BWIPJS.psstring("dontdraw");
this.stk[this.ptr++]=true;
BWIPJS.set(this.stk[this.ptr-3],this.stk[this.ptr-2],this.stk[this.ptr-1]);
this.ptr-=3;
var t=this.dstk.get("options");
if (t instanceof Function) t.call(this); else this.stk[this.ptr++]=t;
this.stk[this.ptr++]=BWIPJS.psstring("format");
this.stk[this.ptr++]=BWIPJS.psstring("rune");
BWIPJS.set(this.stk[this.ptr-3],this.stk[this.ptr-2],this.stk[this.ptr-1]);
this.ptr-=3;
this.stk[this.ptr++]="args";
var t=this.dstk.get("barcode");
if (t instanceof Function) t.call(this); else this.stk[this.ptr++]=t;
var t=this.dstk.get("options");
if (t instanceof Function) t.call(this); else this.stk[this.ptr++]=t;
var t=this.dstk.get("azteccode");
this.stk[this.ptr++]=t;
var t=this.stk[--this.ptr];
if (t instanceof Function) t.call(this); else this.eval(t);
this.dict[this.stk[this.ptr-2]]=this.stk[this.ptr-1]; this.ptr-=2;
var t=this.dstk.get("args");
if (t instanceof Function) t.call(this); else this.stk[this.ptr++]=t;
this.stk[this.ptr++]=BWIPJS.psstring("opt");
var t=this.dstk.get("options");
if (t instanceof Function) t.call(this); else this.stk[this.ptr++]=t;
BWIPJS.set(this.stk[this.ptr-3],this.stk[this.ptr-2],this.stk[this.ptr-1]);
this.ptr-=3;
var t=this.dstk.get("args");
if (t instanceof Function) t.call(this); else this.stk[this.ptr++]=t;
var t=this.dstk.get("dontdraw");
if (t instanceof Function) t.call(this); else this.stk[this.ptr++]=t;
if (typeof(this.stk[this.ptr-1])=="boolean") this.stk[this.ptr-1]=!this.stk[this.ptr-1];
else this.stk[this.ptr-1]=~this.stk[this.ptr-1];
var t=this.dstk.get("renmatrix");
this.stk[this.ptr++]=t;
var t8=this.stk[--this.ptr];
if (this.stk[--this.ptr]) {
if (t8.call(this)==-1) return -1;
}
this.dstk.pop(); this.dict=this.dstk[this.dstk.length-1];
psstptr = this.ptr;
}
BWIPJS.decrefs("aztecrune");
// END OF aztecrune