}
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 }],
)
],
'Code 128' => [
- map { tr/1-3-/❘❙❚ /r }
+ map { $U ? tr/1-3-/❘❙❚ /r : sprintf
+ '<svg width="20" height="14" viewBox="-.5 0 10 7"><path d="M0,0 %s"/></svg>',
+ 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