termcol: declare palette titles in extensible metadata hashes
[sheet.git] / writing-latn.inc.pl
index 28626b06fb63487d9e47ffe66a52f58c3b27db78..1666c6b8ecf89bc57a5687de172e34d07ff219cc 100644 (file)
@@ -3,9 +3,9 @@ use utf8;
 sub disptap {
        return map {
                m/\A(-?)(\d)(\d)/;
-               sprintf('<small style="line-height:2ex">%s</small>&nbsp;',
-                       #TODO: prepend $1
-                       join "<br>\n", '•' x $2, '•' x $3,
+               sprintf('<td style="line-height:1ex"%s>%s<br>%s</td>',
+                       ' class=ex' x !!$1,
+                       '·' x $2, '·' x $3,
                );
        } @_;
 }
@@ -16,7 +16,7 @@ my %C = qw(red #EC1C24  blue #3953A3  yellow #F9EC31  black #231F20);
 'Uppercase' => [qw{ 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 }],
 'Lowercase' => [qw{ 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 }],
 'Sütterlin' => [qw{ 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 }],
-'<abbr title="American Sign Lanugage">ASL</abbr>' => [
+'Sutton <abbr title="American Sign Lanugage">ASL</abbr>' => [
        # American manual alphabet in Sutton (U+1D800+) notation
        map { pack 'W*', map { hex "1D$_" } unpack '(A3)*', $_ } qw{
        8F7a9c    847a9c    86Da9c    801a9c    84Aa9c
@@ -37,7 +37,7 @@ my %C = qw(red #EC1C24  blue #3953A3  yellow #F9EC31  black #231F20);
 })],
 'Tap simplified' => [disptap(qw{
        11 12 13 14 21 22 23 24 31 -31 -13 32 33
-       34 41 42 -13 43 44 15 51 52 53 -25 -31 54
+       34 41 42 -13 43 44 15 51 52 53 25 -31 54
 })],
 'Maritime flags' => [
        # International Code of Signals, SVG fills
@@ -70,7 +70,7 @@ my %C = qw(red #EC1C24  blue #3953A3  yellow #F9EC31  black #231F20);
                <path fill="white" d="M0,0 h15 v30 h-15"/>
 
                <path fill="$C{yellow}" d="M0,0 h30v30 h-30z"/>
-               <circle fill="black" r="7.5" cx="15" cy="15"/>
+               <circle fill="$C{black}" r="7.5" cx="15" cy="15"/>
 
                <path fill="$C{blue}" d="M0,0 h30v30 h-30z"/>
                <path fill="white" d="M0,10 h30 v10 h-30"/>
@@ -141,12 +141,11 @@ my %C = qw(red #EC1C24  blue #3953A3  yellow #F9EC31  black #231F20);
                local $_ = $_;
                s/[1-4]\K(?=[4-9])/ /;
                tr/1-9/↙←↖↑↗→↘↓/;
-               s{(.)(?=.)}{<span style="position:absolute">$1</span>}
-                       or s/^/<span>/ and $_ .= '</span>';
+               s{(\S)(?=.)}{<span style="position:absolute">$1</span>};
                $_
        }
        qw(
-               1 2 3 4 5  6 7 21 31 46  14 15 16 17 23
+               1 2 3 4 5  6 7 21 31 46  14 51 16 17 23
                24 25 26 27 34  35 47 56 57 36  67
        )
 ],
@@ -156,8 +155,8 @@ my %C = qw(red #EC1C24  blue #3953A3  yellow #F9EC31  black #231F20);
                !$_ ? '-' : sprintf(
                        join('',
                                '<svg width="20" height="20" viewBox="0 0 10 15">',
-                               '<path stroke="black" d="M5,6 v7"/>',
-                               '<path stroke="black" fill="none" d="M0,%s h10 %s" transform="rotate(%d 5 6)"/>',
+                               '<path stroke="currentColor" d="M5,6 v7"/>',
+                               '<path stroke="currentColor" fill="none" d="M0,%s h10 %s" transform="rotate(%d 5 6)"/>',
                                '</svg>',
                        ),
                        ['6', '3v3', '9v-3']->[$pl],
@@ -176,10 +175,10 @@ my %C = qw(red #EC1C24  blue #3953A3  yellow #F9EC31  black #231F20);
        map { !$_ ? '-' : sprintf
                join('',
                        '<svg width="20" height="20" viewBox="0 0 8 18">',
-                       '<path stroke="black" d="M4,1 v18"/>',
+                       '<path stroke="currentColor" d="M4,1 v18"/>',
                        (map {(
-                               qq(<path stroke="black" d="M0 $_ h4" transform="rotate(%d 4 $_)"/>),
-                               qq(<path stroke="black" d="M4 $_ h4" transform="rotate(-%d 4 $_)"/>),
+                               qq(<path stroke="currentColor" d="M0 $_ h4" transform="rotate(%d 4 $_)"/>),
+                               qq(<path stroke="currentColor" d="M4 $_ h4" transform="rotate(-%d 4 $_)"/>),
                        )} 3, 7, 14),
                        '</svg>',
                ),
@@ -200,10 +199,18 @@ my %C = qw(red #EC1C24  blue #3953A3  yellow #F9EC31  black #231F20);
                201112 102112 202111 101212 201211 102211
        )
 ],
+'Code 128' => [
+       map { tr/1-3-/❘❙❚ /r }
+       # bar widths (1-3) followed by space of width 1 (implied) or 3 (-)
+       qw(
+               11-2 1-12 1-1-2 12-1 1-21 1-2-1 21-1 2-11 2-1-1 123  12-3 1-23 132
+               13-2 1-32 332   21-3 2-13 231   23-1 233  312   31-2 3-12 321  32-1
+       )
+],
 '<abbr title="Royal Mail 4-State Customer Code">RM4SCC</abbr>' => [
        map { sprintf
                '<svg width="20" height="20" viewBox="0 0 8 6">'
-               . '<path stroke="black" d="M1%s"/></svg>',
+               . '<path stroke="currentColor" d="M1%s"/></svg>',
                join ' m2',
                map { sprintf ',%dv%dm0,-%d',
                        ($_ & 1 ? 0 : 2),  2 + ($_ & 2) + ($_ & 1) * 2,
@@ -231,8 +238,8 @@ my %C = qw(red #EC1C24  blue #3953A3  yellow #F9EC31  black #231F20);
                s/(?:h|m[^0]).*?h\K/-/;
                m/h/ or s/v/l3,/g;
                m/v/ or s/h([^h]*)/l$1,3/g;
-               my $dot = s/\.// && qq(<circle cx="3" cy="3" r="1">);
-               qq(<path stroke="black" stroke-linecap="square" fill="none" d="$_"/>$dot)
+               my $dot = s/\.// && qq(<circle cx="3" cy="3" r="1" fill="currentColor">);
+               qq(<path stroke="currentColor" stroke-linecap="square" fill="none" d="$_"/>$dot)
        }
        qw(
                Hvh  vhv  vh  hvh  vhvh  Hhvh  hv  Vvhv  Hhv
@@ -246,7 +253,7 @@ my %C = qw(red #EC1C24  blue #3953A3  yellow #F9EC31  black #231F20);
        map { sprintf
                '<svg width="14" height="14" viewBox="-.5 -.5 5 5">'
                . '<path%s d="M0,0%s %s4,0 %s4,4 %s0,4 %s0,0"/></svg>',
-               ' stroke="black" stroke-linecap="round" stroke-linejoin="round" fill="none"',
+               ' stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" fill="none"',
                'h.5v.5h-.5v-.5',  # start anchor
                map { ['M', 'h0M', 'L']->[$_] }
                split //, $_