latin: rm4scc circumfix
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 10 Apr 2017 23:29:51 +0000 (01:29 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 22 May 2017 15:55:28 +0000 (17:55 +0200)
Include start and (distinct) end lines in samples, to better match the
official specification, even though it remains invalid by not appending
the checksum mark.

latinsample.js
writing-latn.inc.pl

index 3ef69a4620ae39f879c65ba09217d17885ba6ced..a3ce6dbd03192a29484e3d398cf894453fe3fb22 100644 (file)
@@ -55,7 +55,7 @@ function appendsample() {
                }
                if (cols[29] && !cols[28]) {
                        // circumfix sign if no repetition
-                       output = cols[29] + output + cols[29];
+                       output = cols[29] + output + (cols[30] || cols[29]);
                }
                samplecol.innerHTML = output;
        }
index 2eadbc76444b2e67418599ea052ed9ca11ab5ac1..f313a315cc56d1d28aaae5e07f26fd823c23c0d0 100644 (file)
@@ -301,15 +301,19 @@ my $U = 0;  # optional unicode alternatives
        )
 ],
 '<abbr title="Royal Mail 4-State Customer Code">RM4SCC</abbr>' => [
-       map { sprintf
-               '<svg width="20" height="20" viewBox="0 0 8 6">'
-               . '<path 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 //
+       map {
+               my $len = length $_;
+               !$len ? '' : sprintf(
+                       '<svg width="%d" height="20" viewBox="0 0 %d 6">'
+                       . '<path d="M1%s"/></svg>',
+                       $len * 5, $len * 2,
+                       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
@@ -318,7 +322,8 @@ my $U = 0;  # optional unicode alternatives
                1032 1212 1230 3012 3030 3210
                1122 1302 1320 3102 3120 3300
                0033
-       ) # 0 for space
+       ), # 0 for space
+       '', 1, 3  # start/end
 ],
 'Pigpen' => [
        map {