charset: utf-8 byte function table
[sheet.git] / unicode.plp
index 8dfe1322ba87b1aeab5cf6bf457908b1c2af7e6a..25f89de638afb27cdbe212c52b7cea65eb9e5d63 100644 (file)
@@ -16,10 +16,16 @@ $header{content_type} = 'text/html; charset=utf-8';
 <head>
 <title>digraph cheat sheet</title>
 <meta http-equiv="content-type" content="utf-8">
 <head>
 <title>digraph cheat sheet</title>
 <meta http-equiv="content-type" content="utf-8">
-<link rel="stylesheet" type="text/css" media="all" href="/digraphs.css">
+<link rel="stylesheet" type="text/css" media="all" href="/base.css"><:
+       my %styles = map {$_ => $_} qw(dark circus mono red terse);
+       our $style = exists $get{style} && $styles{$get{style}} || 'light';
+       printf(qq{\n<link rel="%s" type="text/css" media="all" href="%s" title="%s">},
+               $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "$_.css", $_
+       ) for keys %styles;
+:>
 </head>
 
 </head>
 
-<body>
+<body id="unicode">
 <h1>Common uncommon Unicode</h1>
 
 <p>i^k in <a href="/">Vim</a>.
 <h1>Common uncommon Unicode</h1>
 
 <p>i^k in <a href="/">Vim</a>.
@@ -59,7 +65,6 @@ sub glyph_table {
 
        my $colspan = 1;
        for my $cell (@$digraphs) {
 
        my $colspan = 1;
        for my $cell (@$digraphs) {
-               my $class;
                if ($cell =~ s/^\.//) {
                        # dot indicates start of a new row
                        push @rows, '';
                if ($cell =~ s/^\.//) {
                        # dot indicates start of a new row
                        push @rows, '';
@@ -80,30 +85,37 @@ sub glyph_table {
                my $name = $diinfo->{$code}->[1];
 
                # determine display class
                my $name = $diinfo->{$code}->[1];
 
                # determine display class
-               if ($cell =~ s/^-//) {
-#                      $class = 'Empty';
+               my @class;
+               if ($cell eq '-') {
+                       $cell = '';
                }
                elsif ($cell eq '=') {
                }
                elsif ($cell eq '=') {
-                       $class = 'Reserved';
+                       push @class, 'di-invalid';
                        $cell = '';
                }
                        $cell = '';
                }
-               elsif ($cell =~ /[ -~]/) {
-                       $class = 'Ascii';
-               }
-               elsif (not $code) {
-                       $class = 'DiNone';
-               }
-               elsif ($diinfo->{$code}->[2] =~ /\bXz\b/) {
-                       $class = 'DiProp';
-               }
                else {
                else {
-                       $class = 'Di';
+                       if ($cell =~ s/^-//) {
+                               push @class, 'di-rare'; # discouraged
+                       }
+
+                       if ($code) {
+                               push @class, 'di-d'; # digraph
+                               push @class, 'di-prop' # unofficial
+                                       if $diinfo->{$code}->[2] =~ /\bXz\b/;
+                       }
+
+                       if ($cell =~ /[ -~]/) {
+                               push @class, 'di-a'; # ascii
+                       }
+                       else {
+                               push @class, 'di-b'; # basic unicode
+                       }
                }
 
                # add cell html
                $rows[-1] .= sprintf('<td%s%s%s>%s%s',
                        defined $name  ? qq{ title="$name"}  : '',
                }
 
                # add cell html
                $rows[-1] .= sprintf('<td%s%s%s>%s%s',
                        defined $name  ? qq{ title="$name"}  : '',
-                       defined $class ? qq{ class="$class"} : '',
+                       @class ? sprintf(' class="%s"', join ' ', @class) : '',
                        $colspan > 1 && qq{ colspan="$colspan"},
                        $cell eq '' ? '&nbsp;' : quote($cell),
                        $code ne '' ? sprintf(' <small class="digraph">%s</small>', quote($code))
                        $colspan > 1 && qq{ colspan="$colspan"},
                        $cell eq '' ? '&nbsp;' : quote($cell),
                        $code ne '' ? sprintf(' <small class="digraph">%s</small>', quote($code))
@@ -131,16 +143,16 @@ sub print_glyph_tables {
 
 print_glyph_tables(
        'Popular',
 
 print_glyph_tables(
        'Popular',
-       [qw{. « » . ‹ › . ‘ ’ . “ ” . „ ‚}],
-       [qw{. † ‡ • . § ¶ # . © ® ™ . − × ÷ . ± ² √}],
+       [qw{. « » . ‹ › . ‘ ’ . “ ” . „ ‚ . ‟ ‛}],
+       [qw{. † ‡ • . § ¶ # . © ® ™ . ° ′ ″ . − × ÷ . ± ² √}],
        [qw{. å ä ö ü ß . Å æ ø ű ſ}],
        [qw{. ¿ ç ñ é ê è}],
 
        'Arrows',
        [qw{. ↖ ↑ ↗ ↔ . ← - → ↕ . ↙ ↓ ↘ -}],
        [qw{. ⇖ ⇑ ⇗ ⇔ . ⇐ - ⇒ ⇕ . ⇙ ⇓ ⇘ -}],
        [qw{. å ä ö ü ß . Å æ ø ű ſ}],
        [qw{. ¿ ç ñ é ê è}],
 
        'Arrows',
        [qw{. ↖ ↑ ↗ ↔ . ← - → ↕ . ↙ ↓ ↘ -}],
        [qw{. ⇖ ⇑ ⇗ ⇔ . ⇐ - ⇒ ⇕ . ⇙ ⇓ ⇘ -}],
-       [qw{. ◤ ▲ ◥ . ◀ ◆ ▶ . ◣ ▼ ◢}],
-       [qw{. ◸ △ ◹ . ◁ ◇ ▷ . ◺ ▽ ◿}],
+       [qw{. ◤ ▲ ◥   . ◀ ◆ ▶   . ◣ ▼ ◢  }],
+       [qw{. ◸ △ ◹   . ◁ ◇ ▷   . ◺ ▽ ◿  }],
 
        'Line drawing',
        [qw{. ┌ ┬ ┐ . ├ ┼ ┤ . └ ┴ ┘}],
 
        'Line drawing',
        [qw{. ┌ ┬ ┐ . ├ ┼ ┤ . └ ┴ ┘}],
@@ -176,8 +188,8 @@ print_glyph_tables(
                - BiL:Bilabial LD:Labiodental D:Dental Alv:Alveolar PA:Postalveolar
                  Rf:Retroflex Pal:Palatal Vel:Velar Uv:Uvular Ph:Pharyngeal
                  EG:Epiglottal Gl:Glottal
                - BiL:Bilabial LD:Labiodental D:Dental Alv:Alveolar PA:Postalveolar
                  Rf:Retroflex Pal:Palatal Vel:Velar Uv:Uvular Ph:Pharyngeal
                  EG:Epiglottal Gl:Glottal
-               .>Plosive                   p  p̪  >  >  t  ʈ  c  k  q  =  ʡ  ʔ
-               .>Voiced_Plosive            b  b̪  >  >  d  ɖ  ɟ  ɡ  ɢ  =  -  =
+               .>Plosive                   p   >  >  t  ʈ  c  k  q  =  ʡ  ʔ
+               .>Voiced_Plosive            b   >  >  d  ɖ  ɟ  ɡ  ɢ  =  -  =
                .>Nasal                     m  ɱ  >  >  n  ɳ  ɲ  ŋ  ɴ  =  =  =
                .>Trill                     ʙ  -  >  >  r  -  -  =  ʀ  =  -я =
                .>Tap/flap                  -  ⱱ  >  >  ɾ  ɽ  -  =  ɢ̆  =  -  =
                .>Nasal                     m  ɱ  >  >  n  ɳ  ɲ  ŋ  ɴ  =  =  =
                .>Trill                     ʙ  -  >  >  r  -  -  =  ʀ  =  -я =
                .>Tap/flap                  -  ⱱ  >  >  ɾ  ɽ  -  =  ɢ̆  =  -  =
@@ -190,13 +202,16 @@ print_glyph_tables(
                .>Click                     ʘ  -  ǀ  ǁ  ǃ  -‼ ǂ  -  -  =  =  =
                .>Implosive                 ɓ  ɗ̪  >  >  ɗ  -ᶑ ʄ  ɠ  ʛ  =  =  =
        }],
                .>Click                     ʘ  -  ǀ  ǁ  ǃ  -‼ ǂ  -  -  =  =  =
                .>Implosive                 ɓ  ɗ̪  >  >  ɗ  -ᶑ ʄ  ɠ  ʛ  =  =  =
        }],
+       [qw{
+               co . ɕ . ʑ . ɧ . ɥ . ʍ . w
+       }],
        [(
                '-',
                map { substr($_, 0, 1).':'.$_, substr($_, 0, 1)." r:$_ rounded" }
                qw{Front Central Back}
        ), qw{
                .>Close      i y  ɨ ʉ  ɯ u
        [(
                '-',
                map { substr($_, 0, 1).':'.$_, substr($_, 0, 1)." r:$_ rounded" }
                qw{Front Central Back}
        ), qw{
                .>Close      i y  ɨ ʉ  ɯ u
-               .>Near-close - ɪ  ʏ -  ʊ -
+               .>Near-close ɪ ʏ  - -  - ʊ
                .>Close-mid  e ø  ɘ ɵ  ɤ o
                .>Mid        - -  ə -  - -
                .>Open-mid   ɛ œ  ɜ ɞ  ʌ ɔ
                .>Close-mid  e ø  ɘ ɵ  ɤ o
                .>Mid        - -  ə -  - -
                .>Open-mid   ɛ œ  ɜ ɞ  ʌ ɔ
@@ -224,7 +239,7 @@ print_glyph_tables(
                .>M ま み む め も =
                .>Y や =  ゆ =  よ =
                .>R ら り る れ ろ =
                .>M ま み む め も =
                .>Y や =  ゆ =  よ =
                .>R ら り る れ ろ =
-               .>W わ ゐ =  ゑ を =
+               .>W わ -ゐ = -ゑ を =
        }],
        [qw{
                  - A  I  U  E  O
        }],
        [qw{
                  - A  I  U  E  O
@@ -260,11 +275,21 @@ print_glyph_tables(
 
 :></div>
 
 
 :></div>
 
-<p id="footer">
-       <a href="http://vi.shiar.net/unicode">vi.<strong>shiar.net</strong>/unicode</a>
-       <a href="git://dev.shiar.net/vi-cheat"><:= "v$VERSION" :></a>
-       created by Shiar •
-       <a title="Licensed under the GNU Affero General Public License, version 3"
+<div class="legend">
+       <table class="glyphs"><tr>
+       <td class="X di-a">ascii
+       <td class="X di-d">digraph
+       <td class="X di-prop">proposed
+       <td class="X di-b">other unicode
+       <td class="X di-rare">discouraged
+       </table>
+</div>
+
+<p class="footer">
+       <a href="http://sheet.shiar.nl/" rel="home">sheet.shiar.nl</a>/unicode
+       <a href="git://dev.shiar.nl/sheet" rel="vcs-git" title="Git repository"><:= "v$VERSION" :></a>
+       created by <a href="http://shiar.nl/" rel="author">Shiar</a> •
+       <a title="Licensed under the GNU Affero General Public License, version 3" rel="copyright"
           href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">AGPLv3</a> •
        last update <:
                use Time::Format qw(time_format);
           href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">AGPLv3</a> •
        last update <:
                use Time::Format qw(time_format);