unicode: support legend in common method
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 23 Apr 2017 19:10:36 +0000 (21:10 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 25 May 2017 20:13:06 +0000 (22:13 +0200)
Shiar_Sheet/FormatChar.pm
unicode.plp

index 839144f..b2e4d09 100644 (file)
@@ -275,13 +275,21 @@ sub print {
 }
 
 sub legend {
-       my @classes = (
+       my $self = shift;
+       my @classes = $self->{style} eq 'univer' ? (
                [l5 => 'unicode 1.1'],
                [l4 => '20th century'],
                [l3 => 'in 6.0 (2010)'],
                [l2 => 'recent assignments'],
                [l1 => 'proposed'],
                [ex => 'irregular'],
+       ) : (
+               [l5 => 'ascii'],
+               [l4 => $self->{style} eq 'di' ? 'digraph' : 'latin1'],
+               [l3 => $self->{style} eq 'di' ? 'proposed' : 'HTML4'],
+               [l2 => 'unicode ≤6.0'],
+               [l1 => 'other unicode'],
+               [ex => 'discouraged'],
        );
 
        return (
index 0ec6374..245be47 100644 (file)
@@ -158,18 +158,10 @@ $glyphs->print(map {
        }
 } @config);
 
-:></div>
-
-<div class="legend">
-       <table class="glyphs"><tr>
-       <td class="X l5">ascii
-       <td class="X l4"><:= $glyphs->{style} eq 'di' ? 'digraph' : 'latin1' :>
-       <td class="X l3"><:= $glyphs->{style} eq 'di' ? 'proposed' : 'HTML4' :>
-       <td class="X l2">unicode ≤6.0
-       <td class="X l1">other unicode
-       <td class="X ex">discouraged
-       </table>
-</div>
+say "</div>\n";
 
+say for $glyphs->legend;
+
+:>
 <script type="text/javascript" src="/clipboard.js"></script>