From 378bf4526ac991fbbcc8b84f97677aa0ed614da4 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sat, 22 Aug 2015 06:20:17 +0200 Subject: [PATCH] aztec scan code in block drawing characters MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. --- unicode.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/unicode.txt b/unicode.txt index 3624b6f..dd8693f 100644 --- a/unicode.txt +++ b/unicode.txt @@ -317,11 +317,11 @@ Box drawing alignment tests: ││╠╬╣║│ ├╢│ │╟┤ ┣┿╾╳╼┿┫ ┕┛┖┚ ╹╵ ┆▌▐ ▌▐┇ ▌ ││╚╩╝║│ │║╰─╯║│ ┃│╱╽╲│┃ ┏┯┓ ┌┰┐ ┆▌▝▀▘▐╏ ▋ ╞╪═══╬╡ │╙─┬─╜│ ┃└─╂─┘┃ ┠┼┨ ┝╋┥ ┊▙▄▄▄▟╏ ▊ - └┴───╨┘ ╘══╧══╛ ┗━━┻━━┛ ┗┷┛ └┸┘ ┕┉┅┅╍╍┛ ▉ - █ - ▄█▄ █▄ ▄ - ▄█▀█▓ ▄▓▀▀█▀ ▀▀▀█▓▀▀ ▀▀ ▄█▀█▓▀▀▀▀▀▓▄▀██▀▀ (\__/) - ██ ██ ▀██▄▄ ▄█ ▀ ░▒ ░▒ ██ ██ ▄█▄ █▀ ██ (=’.’=) - █▓▄▀██ ▄ ▀█▌▓█ ▒▓ ▒▓ █▓▄▀██ ▓█ ▀▄ █▓ ☆(”)_(”)☆ - █▒ █▓ ██▄▓▀ ▀█▄▄█▄▓█ ▓█ █▒ █▓ ▒█ ▓█▄ ▒ - ▀▒ ▀ ▀ █▀ ▀▒ █ █▀ ░ ヽ༼。◕ ∀ ◕。༽ノ + └┴───╨┘ ╘══╧══╛ ┗━━┻━━┛ ┗┷┛ └┸┘ ┕┉┅┅╍╍┛ ▉ ▗▄▖▄▖ + █ ▐▄▞▀▐▚▗▘ + ▄█▄ █▄ ▄ ▗▛▛▀▀▀▛▙ + ▄█▀█▓ ▄▓▀▀█▀ ▀▀▀█▓▀▀ ▀▀ ▄█▀█▓▀▀▀▀▀▓▄▀██▀▀ (\__/) ▞▌▛▀▌▌▜ + ██ ██ ▀██▄▄ ▄█ ▀ ░▒ ░▒ ██ ██ ▄█▄ █▀ ██ (=’.’=) ▐▜▌▌▘▌▛▙ + █▓▄▀██ ▄ ▀█▌▓█ ▒▓ ▒▓ █▓▄▀██ ▓█ ▀▄ █▓ ☆(”)_(”)☆ ▐▐▌▀▀▘█▖ + █▒ █▓ ██▄▓▀ ▀█▄▄█▄▓█ ▓█ █▒ █▓ ▒█ ▓█▄ ▒ ▗ ▀▛▜▜▀▘ + ▀▒ ▀ ▀ █▀ ▀▒ █ █▀ ░ ヽ༼。◕ ∀ ◕。༽ノ ▝ ▗▞▖▗▘▗ -- 2.30.0