keys: lower background letters in portrait styling
[sheet.git] / writing-latn.inc.pl
index 525daf2ed41b65d0e45b93460e836acaf703f7a7..57193c8c8376d96f14be33b60a24b625537d5404 100644 (file)
@@ -12,14 +12,17 @@ my %C = (
 my $U = 0;  # optional unicode alternatives
 
 my @wrapstyle = (
-       'td { white-space: normal; word-spacing: 10em }', # force line break between words
+       'td { white-space: normal; word-spacing: 10em }',
+               # force line break between words
        '.sample { word-spacing: 0 }',
-       '.sample span { margin-right: 1ex; white-space: nowrap; display: inline-block }', # larger space between letters
+       '.sample span { margin-right: 1ex; white-space: nowrap; display: inline-block }',
+               # larger space between letters
 );
-my $spacestyle = '.sample span { margin-right: 0.5ex }';  # separate multiple letters
+my $spacestyle = '.sample span { margin-right: 0.5ex }';  # separate letters
 my @tapstyle = (
        @wrapstyle,
        '{ line-height: 1ex }',
+       'td:not(.sample) { vertical-align: top }',
        '.sample { font-size: 80% }',
 );
 
@@ -97,7 +100,7 @@ lowercase => {
        list => [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 }],
 },
 suetterlin => {
-       title => 'Sütterlin',
+       name => 'Sütterlin',
        style => [
                '@font-face {
                        font-family: Suetterlin; /* R. G. Arens */
@@ -108,15 +111,15 @@ suetterlin => {
        list => [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 }],
 },
 roman => {
-       title => 'Old Roman Cursive',
+       name => 'Old Roman Cursive',
        style => [
                'svg path { stroke-linecap: round; stroke-linejoin: round }',
                '.sample span { margin-right: -10px }',
        ],
        list => [
                map {
-                       !m/^(-?)(\w.+)/ ? $_ :
-                       $1.'<svg width="20" height="20" viewBox="0 0 12 20"><path d="'.$2.'"/></svg>'
+                       s{\A-?\K(\w.+)}
+                        {<svg width="20" height="20" viewBox="0 0 12 20"><path d="$1"/></svg>}r
                }
                "m2,4 c1,2 8,9 8,9 M2,15 6,9",
                "m2,4 c0,0 3,-2 4,1 1,2 0,9 3,9 1,-0 2,-1 2,-1 m-6,-2 c-5,4 -0,6 1,3",
@@ -147,7 +150,7 @@ roman => {
        ],
 },
 sutton => {
-       title => 'Sutton <abbr title="American Sign Lanugage">ASL</abbr>',
+       name => 'Sutton <abbr title="American Sign Lanugage">ASL</abbr>',
        style => $spacestyle,
        list => [
                # American manual alphabet in Sutton (U+1D800+) notation
@@ -162,7 +165,7 @@ sutton => {
        }],
 },
 unistrokes => {
-       title => 'Unistrokes',
+       name => 'Unistrokes',
        url   => 'https://www.google.com/patents/US5596656', # by Xerox
        style => 'svg path { stroke-linecap: round; stroke-linejoin: round }',
        list => [
@@ -201,7 +204,7 @@ unistrokes => {
        ],
 },
 edgewrite => {
-       title => 'EdgeWrite',
+       name => 'EdgeWrite',
        url   => 'http://depts.washington.edu/ewrite/', # patented US7729542
        style => 'svg path { stroke-linecap: round; stroke-linejoin: round }',
        list => [
@@ -209,12 +212,14 @@ edgewrite => {
                map {
                        my @route = split //;
                        my @coords = map { $_ % 2 << 3, $_ >> 1 << 3 } @route; # x,y,
-                       sprintf('<circle cx="%s" cy="%s" r="1"/>', @coords[0, 1]) . # start point
-                       sprintf('<path d="M%s"/>', join ' ', map {
-                               my $pos = join(',', @coords[$_*2, $_*2 + 1]);
-                               $_ > 1 && $route[$_] == $route[$_ - 2] ? 'Q4,4 '.$pos.'L' : # curve back
-                               $pos
-                       } 0 .. $#route)
+                       sprintf('<circle cx="%s" cy="%s" r="1"/><path d="M%s"/>',
+                               @coords[0, 1],  # start point
+                               join(' ', map {
+                                       my $pos = join(',', @coords[$_*2, $_*2 + 1]);
+                                       $_ > 1 && $route[$_] == $route[$_ - 2] # curve back
+                                               ? 'Q4,4 '.$pos.'L' : $pos
+                               } 0 .. $#route),
+                       )
                }
                # corners (0..3) clockwise from top-left in order
                qw(
@@ -224,10 +229,10 @@ edgewrite => {
        ],
 },
 #graffiti => {
-#      title => 'Palm Graffiti',
+#      name => 'Palm Graffiti',
 #},
 ita2 => {
-       title => '<abbr title="International Telegraph Alphabet">ITA</abbr>2',
+       name => '<abbr title="International Telegraph Alphabet">ITA</abbr>2',
        style => [@wrapstyle, 'td { font-size: 50% }'],
        list => [map { tr/01/○●/r =~ s/..\K/ /r } qw(
                11000 10011 01110 10010 10000 10110 01011 00101 01100 11010 11110 01001 00111
@@ -235,11 +240,43 @@ ita2 => {
                00100
        )],
 },
+moon => {
+       list => [
+               map { qq(<svg width="14" height="14" viewBox="-.5 -.5 7 7"><path d="$_"/></svg>) }
+               'M0,6 3,0 6,6',
+               'M1,0 V4 A2,2 0,0,0 5,4',
+               'M5,0 A4.5,3 0,0,0 5,6',
+               'M1,0 A4.5,3 0,0,1 1,6',
+               'M0,6 V0 H6',
+               'M1,6 V2 A2,2 0,0,1 5,2',
+               'M5,6 V2 A2,2 0,1,0 1,2',
+               'M1.5,3 A1.5,1.5 0,0,0 4.5,3 1.5,1.5 0,0,0 1.5,3 M3,1.5 A1,1.5 0,0,0 3,4.5',
+               'M3,0 V6',
+               'M5,0 V4 A2,2 0,0,1 1,4',
+               'M6,0 0,3 6,6',
+               'M0,0 V6 H6',
+               'M0,0 H6 V6',
+               'M0,6 V2 L6,6 V0',
+               'M0,3 A3,3 0,0,0 6,3 3,3 0,0,0 0,3',
+               'M6,4 H2 A2,1 0,0,1 2,2',
+               'M0,4 H4 A2,1 0,0,0 4,2',
+               'M0,0 6,6',
+               'M0,6 6,0',
+               'M0,3 H6',
+               'M0,0 V3 A3,3 0,0,0 6,3 V0',
+               'M0,0 3,6 6,0',
+               'M0,6 V3 A3,3 0,0,1 6,3 V6',
+               'M0,0 6,3 0,6',
+               'M6,0 V6 H0',
+               'M0,0 H6 L2,6 H6',
+       ],
+       style => 'svg path { stroke-linecap: round; stroke-linejoin: round }',
+},
 braille => {
        list => [qw{ ⠁ ⠃ ⠉ ⠙ ⠑ ⠋ ⠛ ⠓ ⠊ ⠚ ⠅ ⠇ ⠍ ⠝ ⠕ ⠏ ⠟ ⠗ ⠎ ⠞ ⠥ ⠧ ⠺ ⠭ ⠽ ⠵ }],
 },
 tactile => {
-       title => '5-point Tactile',
+       name => '5-point Tactile',
        list => [
                map { '<svg width="9" height="12" viewBox="0 0 18 24">'.$_.'</svg>' }
                map {
@@ -264,7 +301,7 @@ morse => {
        }],
 },
 tap => {
-       title => 'Tap code',
+       name => 'Tap code',
        style => \@tapstyle,
        list => [map { disptap($_) } qw{
                11 12 13 14 15 21 22 23  > 24 25 31 32
@@ -272,7 +309,7 @@ tap => {
        }],
 },
 shorttap => {
-       title => 'Short Tap',
+       name => 'Short Tap',
        style => \@tapstyle,
        list => [map { disptap($_) } qw{
                11 12 13 14 21 22 23 20 > 31 -13 32 33
@@ -287,7 +324,7 @@ cards => {
        ), '', chr(0x1F0CF), chr(0x1F0DF) ],
 },
 maritime => {
-       title => 'Maritime flags',
+       name => 'Maritime flags',
        style => $spacestyle,
        list => [
                # International Code of Signals, SVG fills
@@ -332,7 +369,8 @@ maritime => {
                        <path fill="$C{yellow}" d="M0,0 h15 v15 h-15 M15,15 h15 v15 h-15"/>
 
                        <path fill="white" d="M0,0 h30v30 h-30z"/>
-                       <path fill="$C{blue}" d="M4,0h22l-11,11 M4,30h22l-11,-11 M0,4v22l11,-11 M30,4v22l-11,-11"/>
+                       <path fill="$C{blue}" d="M4,0h22l-11,11 M4,30h22l-11,-11
+                               M0,4v22l11,-11 M30,4v22l-11,-11"/>
 
                        <path fill="white" d="M0,0 h30v30 h-30z"/>
                        <path fill="$C{blue}" d="
@@ -365,7 +403,8 @@ maritime => {
                        <path fill="$C{red}" d="M0,0 h15 v15 h-15 M15,15 h15 v15 h-15"/>
 
                        <path fill="$C{red}" d="M0,0 h30v30 h-30z"/>
-                       <path fill="white" d="M4,0h22l-11,11 M4,30h22l-11,-11 M0,4v22l11,-11 M30,4v22l-11,-11"/>
+                       <path fill="white" d="M4,0h22l-11,11 M4,30h22l-11,-11
+                               M0,4v22l11,-11 M30,4v22l-11,-11"/>
 
                        <path fill="$C{blue}" d="M0,0 h30v30 h-30z"/>
                        <path fill="white" d="M5,5 h20 v20 h-20"/>
@@ -376,8 +415,8 @@ maritime => {
                        <path fill="$C{blue}" d="M0,12.5 h30 v5 h-30"/>
 
                        <path fill="$C{red}" d="M0,0 h30v30 h-30z"/>
-                       <path fill="$C{yellow}" d="M0,0h6l-6,6 M12,0h6l-18,18v-6 M24,0h6l-30,30v-6
-                               M30,6v6l-18,18h-6 M30,18v6l-6,6h-6"/>
+                       <path fill="$C{yellow}" d="M0,0h6l-6,6 M12,0h6l-18,18v-6
+                               M24,0h6l-30,30v-6 M30,6v6l-18,18h-6 M30,18v6l-6,6h-6"/>
 
                        <path fill="$C{black}" d="M0,0 h30v30 h-30z"/>
                        <path fill="$C{blue}" d="M30,0 v31 l-15,-15"/>
@@ -395,7 +434,7 @@ maritime => {
        ],
 },
 flag => {
-       title => 'Flag semaphore',
+       name => 'Flag semaphore',
        list => [
                map {
                        local $_ = $_;
@@ -411,7 +450,7 @@ flag => {
        ],
 },
 chappe => {
-       title => 'Chappe semaphore',
+       name => 'Chappe semaphore',
        list => [
                map {
                        my ($r, $pr, $pl) = split //, $_;
@@ -436,7 +475,7 @@ chappe => {
        ],
 },
 prussian => {
-       title => 'Prussian semaphore',
+       name => 'Prussian semaphore',
        list => [
                map { /^\D+$/ ? $_ : sprintf
                        join('',
@@ -459,7 +498,7 @@ prussian => {
        ],
 },
 code39 => {
-       title => 'Code 39',
+       name => 'Code 39',
        list => [map { dispbar($_) } qw(
                2111121121 1121121121 2121121111 1111221121 2111221111 1121221111
                1111122121 2111122111 1121122111 1111222111 2111111221 1121111221
@@ -469,7 +508,7 @@ code39 => {
        )], # ISO/IEC 16388
 },
 code93 => {
-       title => 'Code 93',
+       name => 'Code 93',
        list => [map { dispbar($_) } qw(
                211113 211212 211311 221112 221211 231111 112113 112212 112311 122112
                132111 111123 111222 111321 121122 131121 212112 212211 211122 211221
@@ -477,15 +516,15 @@ code93 => {
        )],
 },
 code128 => {
-       title => 'Code 128',
+       name => 'Code 128',
        list => [map { dispbar($_) } qw(
                111323 131123 131321 112313 132113 132311 211313 231113 231311 112133
                112331 132131 113123 113321 133121 313121 211331 231131 213113 213311
-               213131 311123 311321 331121 312113 312311        212222 0 211412 23311120
+               213131 311123 311321 331121 312113 312311      212222 0 211412 23311120
        )],
 },
 rm4scc => {
-       title => '<abbr title="Royal Mail 4-State Customer Code">RM4SCC</abbr>',
+       name => '<abbr title="Royal Mail 4-State Customer Code">RM4SCC</abbr>',
        list => [
                map {
                        my $len = length $_;
@@ -513,7 +552,7 @@ rm4scc => {
        ],
 },
 rgbmap => {
-       title => 'RGBmap',
+       name => 'RGBmap',
        style => [
                'svg { isolation: isolate }',
                'svg circle { mix-blend-mode: screen }',
@@ -525,7 +564,7 @@ rgbmap => {
        ],
 },
 cmymap => {
-       title => 'CMYmap',
+       name => 'CMYmap',
        style => [
                'svg { isolation: isolate }',  # mix on white
                'svg circle { mix-blend-mode: multiply }',
@@ -538,10 +577,13 @@ cmymap => {
        ],
 },
 dni => {
-       title => "D'ni",
+       name => "D'ni",
+       style => [
+               'svg { border: 1px solid currentColor }',
+               '.sample span + span svg { border-left: 0 }',
+       ],
        list => [
                map {
-                       state $window = 'M-.5,-.5H8.5V8.5H-.5Z';
                        state $v = [
                                '',
                                'M0,4 8,4',
@@ -558,8 +600,10 @@ dni => {
                                'M4,-.5 0,4 4,8.5',
                                'M4,8 4,2 8,2',
                        ];
-                       sprintf '<svg width="16" height="16" viewBox="-.5 -.5 9 9"><path d="%s"/></svg>',
-                               $window . ($h->[$_ % 5] . $v->[$_ / 5] || $v->[6]);
+                       sprintf(
+                               '<svg width="16" height="16" viewBox="0 0 8 8"><path d="%s"/></svg>',
+                               $h->[$_ % 5] . $v->[$_ / 5] || $v->[6],
+                       );
                } 0 .. 5*5
        ],
 },
@@ -612,14 +656,15 @@ nyctographs => {
                # draw style (0=empty, 1=dot, 2=line connect) to right, down, left, up
                qw(
                        0010 0112 2022 2220 2000 2012 0122 0202 0020 0220 0012 0022 2202
-                       0222 2222 0102 0200 2201 2002 2200 0100 0110 0120 2001 2010 2020 0000
+                       0222 2222 0102 0200 2201 2002 2200 0100 0110 0120 2001 2010 2020
+                       0000
                ),
        ],
 },
 chromacons => {
+       title => 'Colour Alphabet by Paul Green-Armytage (2010)',
 #      style => '.sample { word-break: break-all }',
        list => [
-               # Colour Alphabet by Paul Green-Armytage (2010)
                map {
                        sprintf('<span%s>%s</span>',
                                !!$_ && sprintf(' style="background:#%s" title="%s"', split /:/),
@@ -627,12 +672,13 @@ chromacons => {
                        );
                }
                qw{
-                       F0A3FF:Amethyst 0075DC:Blue      993F00:Caramel  4C005C:Damson   191919:Ebony
-                       005C31:Forest   2BCE48:Green     FFCC99:Honeydew 808080:Iron     94FFB5:Jade
-                       8F7C00:Khaki    9DCC00:Lime      C20088:Mallow
-                       003380:Navy     FFA405:Orpiment  FFA8BB:Pink     426600:Quagmire FF0010:Red
-                       5EF1F2:Sky      00998F:Turquoise E0FF66:Uranium  740AFF:Violet   990000:Wine
-                       FFFF80:Xanthin  FFFF00:Yellow    FF5005:Zinnia   0
+                       F0A3FF:Amethyst 0075DC:Blue     993F00:Caramel  4C005C:Damson
+                       191919:Ebony    005C31:Forest   2BCE48:Green    FFCC99:Honeydew
+                       808080:Iron     94FFB5:Jade     8F7C00:Khaki    9DCC00:Lime
+                       C20088:Mallow   003380:Navy     FFA405:Orpiment FFA8BB:Pink
+                       426600:Quagmire FF0010:Red      5EF1F2:Sky      00998F:Turquoise
+                       E0FF66:Uranium  740AFF:Violet   990000:Wine     FFFF80:Xanthin
+                       FFFF00:Yellow   FF5005:Zinnia   0
                }
        ],
 },