writing: script name outside of table include
[sheet.git] / latin.plp
index 89afb61358b194ecb4f5672ddf5c364de7beddbf..162a0b6d69e14cec796da85b9772a4b53af5b1f4 100644 (file)
--- a/latin.plp
+++ b/latin.plp
@@ -28,13 +28,22 @@ unless (exists $get{v}) {
        $glyphs->{digraph}--;
 }
 
        $glyphs->{digraph}--;
 }
 
-my @t = (qw{
-       .>Latin      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
-       .>Braille    ⠁ ⠃ ⠉ ⠙ ⠑ ⠋ ⠛ ⠓ ⠊ ⠚ ⠅ ⠇ ⠍ ⠝ ⠕ ⠏ ⠟ ⠗ ⠎ ⠞ ⠥ ⠧ ⠺ ⠭ ⠽ ⠵
-       .>Morse      ‧‑ ‑‧‧‧ ‑‧‑‧ ‑‧‧ ‧ ‧‧‐‧ ‐‐‧ ‧‧‧‧ ‧‧ ‧‐‐‐ ‐‧‐ ‧‐‧‧ ‐‐
-                    ‐‧ ‐‐‐ ‧‐‐‧ ‐‐‧‐ ‧‐‧ ‧‧‧ ‐ ‧‧‐ ‧‧‧‐ ‧‐‐ ‐‧‧‐ ‐‧‐‐ ‐‐‧‧
-});
-print $glyphs->table(exists $get{uc} ? [map {s/\s.//; uc} @t] : \@t);
+my %scriptname = (
+       latn     => 'Latin',
+       brai     => 'Braille',
+       morse    => 'Morse',
+);
+
+my @table = do 'writing-latn.inc.pl';
+if ($! or $@) {
+       printf "<p>Table data not found: <em>%s</em>.</p>\n", $! || $@;
+}
+else {
+       print $glyphs->table([map {
+               ref $_ ne 'ARRAY' ? ".>$scriptname{$_}"
+                       : exists $get{uc} ? map {uc} @$_ : @$_
+       } @table]);
+}
 
 print "</div>\n";
 
 
 print "</div>\n";