latin: rm4scc barcode row
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 29 Jul 2015 11:45:28 +0000 (13:45 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 21 Sep 2015 22:20:08 +0000 (00:20 +0200)
Inline SVG generated from 4 digits describing forms (1|2 for line up/down:
unextended, ascended, descended, full height) of 4 bars as described for
example on <https://en.wikipedia.org?oldid=670826999>.

This encoding developed by Royal Mail (identical to PostNL KIX-code)
restricts the 4⁴ combinations to exactly 2 ascenders and 2 descenders each
for 2⋅(4 nCr 2) = 36 characters.

latin.plp
writing-latn.inc.pl

index f292f2ec057f2c900da029372d69f3744d141574..e6ef7a2acd512d9624b5f7ba6728c41baee60863 100644 (file)
--- a/latin.plp
+++ b/latin.plp
@@ -51,6 +51,7 @@ my %scriptname = (
        taps     => 'Tap simplified',
        ics      => 'Maritime flags', # International Code of Signals
        sem      => 'Flag semaphore',
        taps     => 'Tap simplified',
        ics      => 'Maritime flags', # International Code of Signals
        sem      => 'Flag semaphore',
+       rm4scc   => '<abbr title="Royal Mail 4-State Customer Code">RM4SCC</abbr>',
 );
 
 my @table = do 'writing-latn.inc.pl';
 );
 
 my @table = do 'writing-latn.inc.pl';
index 7d0fb06aea9cb237037beff7d8858cd2301f3c77..70a479a2e1f68eca98839dbf627cb6b7b22e771b 100644 (file)
@@ -148,4 +148,23 @@ sem => [
                24 25 26 27 34  35 47 56 57 36  67
        )
 ],
                24 25 26 27 34  35 47 56 57 36  67
        )
 ],
+rm4scc => [
+       map { sprintf
+               '<svg width="20" height="20" viewBox="0 0 8 6">'
+               . '<path stroke="black" d="M1%s"/></svg>',
+               join ' m2',
+               map { sprintf ',%dv%dm0,-%d',
+                       ($_ & 1 ? 0 : 2),  2 + ($_ & 2) + ($_ & 1) * 2,
+                       ($_ & 1 ? 0 : 2) + 2 + ($_ & 2) + ($_ & 1) * 2,
+               }
+               split //, $_
+       }
+       qw(
+                                   2121 2301
+               0132 0312 0330 2112 2130 2310
+               1023 1203 1221 3003 3021 3201
+               1032 1212 1230 3012 3030 3210
+               1122 1302 1320 3102 3120 3300
+       )
+],
 );
 );