X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/b5770997564659fc6a205c774152f6f41d8d1832..9aa3a0089bff9379b25186960929582f16e7b3f4:/unicode.plp diff --git a/unicode.plp b/unicode.plp index cc133d5..9b77f7f 100644 --- a/unicode.plp +++ b/unicode.plp @@ -5,7 +5,7 @@ use warnings; no warnings 'qw'; # that's not a comment, it's a NUMBER SIGN use open IO => ':utf8'; -our $VERSION = '1.0'; +our $VERSION = 'v1.0'; $header{content_type} = 'text/html; charset=utf-8'; @@ -16,7 +16,13 @@ $header{content_type} = 'text/html; charset=utf-8'; digraph cheat sheet - +<: + my %styles = map {$_ => $_} qw(dark circus mono red terse); + our $style = exists $get{style} && $styles{$get{style}} || 'light'; + printf(qq{\n}, + $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "$_.css", $_ + ) for keys %styles; +:> @@ -30,7 +36,7 @@ Also see the complete digraphs table.

<: my $diinfo = do 'digraphs.inc.pl'; my %di = map { $diinfo->{$_}->[0] => $_ } grep { ref $diinfo->{$_} } - keys %$diinfo; + sort { length $a <=> length $b } keys %$diinfo; sub quote { local $_ = shift; @@ -75,8 +81,7 @@ sub glyph_table { next; } - my $code = join '', map { $di{ord $_} || '' } split //, $cell; - my $name = $diinfo->{$code}->[1]; + my ($code, $name); # determine display class my @class; @@ -92,11 +97,18 @@ sub glyph_table { push @class, 'di-rare'; # discouraged } - if ($code) { + $code = join '', map { $di{ord $_} || '' } split //, $cell; + $name = $diinfo->{$code}->[1]; + length $code == 2 or undef $code; + + if (defined $code) { push @class, 'di-d'; # digraph push @class, 'di-prop' # unofficial if $diinfo->{$code}->[2] =~ /\bXz\b/; } + elsif (defined $name) { + push @class, 'X'; + } if ($cell =~ /[ -~]/) { push @class, 'di-a'; # ascii @@ -112,7 +124,7 @@ sub glyph_table { @class ? sprintf(' class="%s"', join ' ', @class) : '', $colspan > 1 && qq{ colspan="$colspan"}, $cell eq '' ? ' ' : quote($cell), - $code ne '' ? sprintf(' %s', quote($code)) + defined $code ? sprintf(' %s', quote($code)) : length($cell) == 1 && $cell !~ /[a-z]/ ? sprintf(' %04X', 'value', ord $cell) : '', @@ -135,20 +147,39 @@ sub print_glyph_tables { } } +our $verbose = exists $get{v}; + print_glyph_tables( 'Popular', [qw{. « » . ‹ › . ‘ ’ . “ ” . „ ‚ . ‟ ‛}], [qw{. † ‡ • . § ¶ # . © ® ™ . ° ′ ″ . − × ÷ . ± ² √}], + [qw{. ⚋ ⚊ . ⚐ ⚑ . ☺ ☹ . ✓ ✗ . ✔ ✘ . ◄ ► }], [qw{. Ã¥ ä ö ü ß . Å æ ø ű Å¿}], [qw{. ¿ ç ñ é ê è}], + 'Signs', + [qw{. ¤ ¢ ₥ € £ ₨ $ Â¥ . ₫ ₭ ₦ ₱ ₧ ₮ ₩ ₪}], + [qw{. ♠ ♡ ♢ ♣ . ♤ ♥ ♦ ♧}], + [qw{. ☉ ☿ ♀ ♁ ♂ ♃ ♄ ♅ ♆ ♇}], # solar + [qw{. ♈ ♉ ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓}], # zodiac + 'Arrows', [qw{. ↖ ↑ ↗ ↔ . ← - → ↕ . ↙ ↓ ↘ -}], [qw{. ⇖ ⇑ ⇗ ⇔ . ⇐ - ⇒ ⇕ . ⇙ ⇓ ⇘ -}], + [qw{. ⬁ ⇧ ⬀ ⬄ . ⇦ - ⇨ ⇳ . ⬃ ⇩ ⬂ -}], + [qw{. ⬉ ⬆ ⬈ ⬌ . ⬅ - ➡ ⬍ . ⬋ ⬇ ⬊ -}], + [qw{. ◩ ⬒ ⬔ . ◧ □ ◨ . ⬕ ⬓ ◪ }], [qw{. ◤ ▲ ◥ . ◀ ◆ ▶ . ◣ ▼ ◢ }], [qw{. ◸ △ ◹ . ◁ ◇ ▷ . ◺ ▽ ◿ }], +$verbose ? ( + [qw{.    .  -  .    }], + [qw{.    .  -  .    }], +) : (), 'Line drawing', + [qw{. ╔ ╦ ╗ ═ . ╠ ╬ ╣ ║ . ╚ ╩ ╝ - }], + [qw{. ╒ ╤ ╕ . ╞ ╪ ╡ . ╘ ╧ ╛ }], + [qw{. ╓ ╥ ╖ . ╟ ╫ ╢ . ╙ ╨ ╜ }], [qw{. ┌ ┬ ┐ . ├ ┼ ┤ . └ ┴ ┘}], [qw{. ┏ ┳ ┓ . ┣ ╋ ┫ . ┗ ┻ ┛}], [qw{. ┍ ┯ ┑ . ┝ ┿ ┥ . ┕ ┷ ┙}], @@ -160,22 +191,13 @@ print_glyph_tables( . ╹ ┃ ╏ ┇ ┋ ╻ ╽ }], [qw{. ╱ ╳ ╲ }], - [qw{. ╔ ╦ ╗ ═ . ╠ ╬ ╣ ║ . ╚ ╩ ╝ - }], - [qw{. ╒ ╤ ╕ . ╞ ╪ ╡ . ╘ ╧ ╛ }], - [qw{. ╓ ╥ ╖ . ╟ ╫ ╢ . ╙ ╨ ╜ }], 'Blocks', - [qw{. ▘ ▀ ▝ . ▌ █ ▐ . ▖ ▄ ▗ }], + [qw{. □ ▣ ■ . ▤ ▦ ▥ . ▧ ▩ ▨}], [qw{. ░ . ▒ . ▓ }], + [qw{. ▘ ▀ ▝ . ▌ █ ▐ . ▖ ▄ ▗ }], [qw{. ▛ ▚ ▟ . ▙ ▞ ▜ }], [qw{. ▁ ▂ ▃ ▄ ▅ ▆ ▇ ▔ . ▏ ▎ ▍ ▌ ▋ ▊ ▉ ▕ }], - [qw{. □ ▣ ■ . ▤ ▦ ▥ . ▧ ▩ ▨}], - - 'Signs', - [qw{. ¤ ¢ ₥ € £ ₨ $ Â¥ . ₫ ₭ ₦ ₱ ₧ ₮ ₩ ₪}], - [qw{. ♠ ♡ ♢ ♣ . ♤ ♥ ♦ ♧}], - [qw{. ☉ ☿ ♀ ♁ ♂ ♃ ♄ ♅ ♆ ♇}], # solar - [qw{. ♈ ♉ ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓}], # zodiac 'IPA', [qw{ @@ -213,14 +235,7 @@ print_glyph_tables( .>Open a ɶ - - ɑ ɒ }], - 'Alphabetics', - [qw{ - .>Latin a Ä« ı ę ô ɳ ŋ ṡ Å¡ đ ð Æ· - .>Cyrillic а і й э ё н њ ш щ ч ь Я - .>Greek α ί ϊ η ϋ π ψ σ ς θ ξ Ω - .>Hebrew א ײ י ×¢ ו ×  ן ס ש ט צ ×¥ - }], - +$verbose ? ( 'Japanese', [qw{ - A I U E O _ @@ -265,6 +280,7 @@ print_glyph_tables( .>P パ ピ プ ペ ポ .>V ヷ ヸ ヴ ヹ ヺ }], +) : (), ); :> @@ -280,15 +296,11 @@ print_glyph_tables(