aztec scan code in block drawing characters
Test proper rendering and alignment (which can be verified by external scanner)
of an original 2D code creatable using Barcode Writer in Pure PostScript:
cat <<-. |
0 0 moveto (Unicode code) (ecaddchars=2)
/azteccode /uk.co.terryburton.bwipp findresource exec
.
cat /usr/share/libpostscriptbarcode/barcode.ps -
Older 2014 version in Debian needs pre-encoded input to create 15x15 code:
(10110111000111101010001001000000101001100000100100100000010100110)(raw)
Then converted via PBM to 2x2 box characters:
pstopnm -pbm -forceplain -stdout -portrait -xsize 15 \
-llx 0 -lly 0 -urx .42 -ury .42 -xborder 0 -yborder 0 |
perl -CO -ln -e'
use utf8;
/^[01]+$/ or next;
sub halfbits ($;$) {
pack "C*", map { $_ << $_[1] } unpack "C*", # multiply values
pack "(b2)*", split /..\K/, $_[0]; # value of every 2 bits
}
($_) = halfbits($_) | halfbits(<>, 2); # 0..3 + 0,4,8,12
y/\0-\017/ ▘▝▀▖▌▞▛▗▚▐▜▄▙▟█/;
print;
'
Ironically, Aztec Codes do not really support Unicode (raw bytes are
declared to be Latin1), but it's currently the only widely supported 2D code
of this size.