X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/2a817c01f188212c41ee9500b17760a8caa02190..bbd4d489ebb73ed0fbc55eac123614a4774bb937:/writing-latn.inc.pl diff --git a/writing-latn.inc.pl b/writing-latn.inc.pl index 93b5edc..7fabb6e 100644 --- a/writing-latn.inc.pl +++ b/writing-latn.inc.pl @@ -10,6 +10,7 @@ sub disptap { } my %C = qw(red #EC1C24 blue #3953A3 yellow #F9EC31 black #231F20); +my $U = 0; # optional unicode alternatives ( 'Uppercase' => [qw{ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z }], @@ -242,7 +243,16 @@ my %C = qw(red #EC1C24 blue #3953A3 yellow #F9EC31 black #231F20); ) ], 'Code 128' => [ - map { tr/1-3-/❘❙❚ /r } + map { $U ? tr/1-3-/❘❙❚ /r : sprintf + '', + join ' ', + map { + $_ eq '' ? 'm2,-7' : + $_ eq '-' ? 'm4,-7' : + join 'm1,-7', ('v7') x $_ + } + split /(-)?/, $_ # each bar [123] and space [ -] + } # bar widths (1-3) followed by space of width 1 (implied) or 3 (-) qw( 11-2 1-12 1-1-2 12-1 1-21 1-2-1 21-1 2-11 2-1-1 123 12-3 1-23 132