From: Mischa POSLAWSKY Date: Mon, 10 Apr 2017 21:52:01 +0000 (+0200) Subject: latin: circumfix mark for code 39 X-Git-Tag: v1.10~173 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/9b34f6d9fa60d96025fe3835777f277b9cc002ad latin: circumfix mark for code 39 Optional 29th glyph to use as start and end mark in sample text, making it conform to official specifications and recognisable by barcode scanners (verified with ZXing Barcode Scanner on Android). --- diff --git a/latinsample.js b/latinsample.js index b576f95..fa6b0f1 100644 --- a/latinsample.js +++ b/latinsample.js @@ -22,6 +22,9 @@ function appendsample() { cols[++col] = same; } } + for (var col = 0; col < cols.length; col++) { + cols[col] = cols[col].innerHTML.trimRight(); + } // copy letters into sample var output = ''; @@ -34,12 +37,16 @@ function appendsample() { } if (col < cols.length) { - output += '' + (cols[col].innerHTML.trimRight() || ' ') + ''; + output += '' + (cols[col] || ' ') + ''; } else { output += ' '; } } + if (cols[29] && !cols[28]) { + // circumfix sign if no repetition + output = cols[29] + output + cols[29]; + } samplecol.innerHTML = output; } }; diff --git a/writing-latn.inc.pl b/writing-latn.inc.pl index 43b77b3..1be023d 100644 --- a/writing-latn.inc.pl +++ b/writing-latn.inc.pl @@ -256,10 +256,12 @@ my $U = 0; # optional unicode alternatives ], 'Code 39' => [ # ISO/IEC 16388 - map { tr/012/ ❘❙/r } qw( + map { !!$_ && tr/012/ ❘❙/r } + # bar widths (1-2) followed by space of width 1 (implied) or 2 (0) + qw( 211012 121012 221011 112012 212011 122011 111022 211021 121021 112021 211102 121102 221101 112102 212101 122101 111202 211201 121201 112201 - 201112 102112 202111 101212 201211 102211 102121 + 201112 102112 202111 101212 201211 102211 102121 0 101221 ) ], 'Code 93' => [