X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/c74ecf690c0c9047a11049d629a791de47857b53..f58c07717bb2e77d1f5010a23f4986ec85ff4f7a:/unicode.plp diff --git a/unicode.plp b/unicode.plp index 8dfe132..33de0fb 100644 --- a/unicode.plp +++ b/unicode.plp @@ -1,28 +1,22 @@ -<: -use utf8; -use strict; -use warnings; -no warnings 'qw'; # that's not a comment, it's a NUMBER SIGN -use open IO => ':utf8'; - -our $VERSION = '1.0'; - -$header{content_type} = 'text/html; charset=utf-8'; +<(common.inc.plp)><: -:> - +Html({ + title => 'unicode glyph cheat sheet', + version => 'v1.0', + description => [ + "Common Unicode characters with digraph or code point, layed out for quick location.", + "Includes general symbols, arrows, drawing characters, and IPA letters.", + ], + keywords => [qw' + unicode glyph char character reference common ipa symbol sign mark table digraph + '], + stylesheet => [qw'light dark red'], +}); - -digraph cheat sheet - - - +:> +

Common Unicode

- -

Common uncommon Unicode

- -

i^k in Vim. +

i^k in Vim. Also see the complete digraphs table.

@@ -30,15 +24,7 @@ Also see the complete digraphs table.

<: my $diinfo = do 'digraphs.inc.pl'; my %di = map { $diinfo->{$_}->[0] => $_ } grep { ref $diinfo->{$_} } - keys %$diinfo; - -sub quote { - local $_ = shift; - s/"/"/g; - s//>/g; - return $_; -} + sort { length $a <=> length $b } keys %$diinfo; sub glyph_table { my ($digraphs) = @_; @@ -59,7 +45,6 @@ sub glyph_table { my $colspan = 1; for my $cell (@$digraphs) { - my $class; if ($cell =~ s/^\.//) { # dot indicates start of a new row push @rows, ''; @@ -76,37 +61,49 @@ sub glyph_table { next; } - my $code = join '', map { $di{ord $_} || '' } split //, $cell; - my $name = $diinfo->{$code}->[1]; + my ($code, $name); # determine display class - if ($cell =~ s/^-//) { -# $class = 'Empty'; + my @class; + if ($cell eq '-') { + $cell = ''; } elsif ($cell eq '=') { - $class = 'Reserved'; + push @class, 'di-invalid'; $cell = ''; } - elsif ($cell =~ /[ -~]/) { - $class = 'Ascii'; - } - elsif (not $code) { - $class = 'DiNone'; - } - elsif ($diinfo->{$code}->[2] =~ /\bXz\b/) { - $class = 'DiProp'; - } else { - $class = 'Di'; + push @class, 'X'; + + if ($cell =~ s/^-//) { + push @class, 'di-rare'; # discouraged + } + + $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/; + } + + if ($cell =~ /[ -~]/) { + push @class, 'di-a'; # ascii + } + else { + push @class, 'di-b'; # basic unicode + } } # add cell html $rows[-1] .= sprintf('%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 '' ? ' ' : quote($cell), - $code ne '' ? sprintf(' %s', quote($code)) + $cell eq '' ? ' ' : EscapeHTML($cell), + defined $code ? sprintf(' %s', EscapeHTML($code)) : length($cell) == 1 && $cell !~ /[a-z]/ ? sprintf(' %04X', 'value', ord $cell) : '', @@ -121,7 +118,7 @@ sub glyph_table { sub print_glyph_tables { while (@_) { - printf "

%s

\n\n", shift; + printf '

%s

'."\n\n", shift; while (ref $_[0] and $_ = shift) { print glyph_table($_); } @@ -129,20 +126,50 @@ sub print_glyph_tables { } } +our $verbose = exists $get{v}; + print_glyph_tables( 'Popular', - [qw{. « » . ‹ › . ‘ ’ . “ ” . „ ‚}], - [qw{. † ‡ • . § ¶ # . © ® ™ . − × ÷ . ± ² √}], - [qw{. å ä ö ü ß . Å æ ø ű ſ}], + [qw{. « » . ‹ › . ‘ ’ . “ ” . „ ‚ . ‟ ‛}], + [qw{. † ‡ • . § ¶ # . © ® ™ . ° ′ ″ . − × ÷ . ± ² √}], + [qw{. ⚋ ⚊ . ⚐ ⚑ . ☺ ☹ . ✓ ✗ . ✔ ✘ }], + [qw{. å ä ö ü ß . ā æ ø ű ſ}], [qw{. ¿ ç ñ é ê è}], + [qw{. α β}], [qw{. א}], + + 'Symbols', + [qw{. ¤ ¢ ₥ € £ ₨ $ ¥ . ฿ ₫ ₭ ₦ ₱ ₮ ₩ ₪}], + [qw{. ♠ ♡ ♢ ♣ . ♤ ♥ ♦ ♧}], + [qw{. ☮ ☯ ☻ ♪ ♲ ♿ }], + [qw{. ✂ ✉ ☎ }], [qw{. ⚠ ☡ ☠}], + 'Signs', + [qw{. ☉ ☿ ♀ ♁ ♂ ♃ ♄ ♅ ♆ ♇}], # solar + [qw{. ♈ ♉ ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓}], # zodiac + + 'Key commands', + [qw{. ⇥ ⇤ . ␣ ⌫ }], # common spacing + [qw{. ⎀ ⇱ ⇞ . ⌦ ⇲ ⇟ }], # edit block + [qw{. ⇪ ⇯ ⇭ . ⇧ ⇮ № }], # modifier + [qw{. ⎈ ⌥ ⌘ ⎄ }], [qw{. ↵ ⎋ ⎉ ⎊ }], # command + [qw{. ► ⏩ ⏭ ◼ ⚫ . ◄ ⏪ ⏮ ⏏ -❚❚ }], # player ui 'Arrows', [qw{. ↖ ↑ ↗ ↔ . ← - → ↕ . ↙ ↓ ↘ -}], [qw{. ⇖ ⇑ ⇗ ⇔ . ⇐ - ⇒ ⇕ . ⇙ ⇓ ⇘ -}], - [qw{. ◤ ▲ ◥ . ◀ ◆ ▶ . ◣ ▼ ◢}], - [qw{. ◸ △ ◹ . ◁ ◇ ▷ . ◺ ▽ ◿}], + [qw{. ⬁ ⇧ ⬀ ⬄ . ⇦ - ⇨ ⇳ . ⬃ ⇩ ⬂ -}], + [qw{. ⬉ ⬆ ⬈ ⬌ . ⬅ - ➡ ⬍ . ⬋ ⬇ ⬊ -}], + [qw{. ◩ ⬒ ⬔ . ◧ □ ◨ . ⬕ ⬓ ◪ }], + [qw{. ◤ ▲ ◥ . ◀ ◆ ▶ . ◣ ▼ ◢ }], + [qw{. ◸ △ ◹ . ◁ ◇ ▷ . ◺ ▽ ◿ }], +$verbose ? ( + [qw{.    .  -  .    }], + [qw{.    .  -  .    }], +) : (), 'Line drawing', + [qw{. ╔ ╦ ╗ ═ . ╠ ╬ ╣ ║ . ╚ ╩ ╝ - }], + [qw{. ╒ ╤ ╕ . ╞ ╪ ╡ . ╘ ╧ ╛ }], + [qw{. ╓ ╥ ╖ . ╟ ╫ ╢ . ╙ ╨ ╜ }], [qw{. ┌ ┬ ┐ . ├ ┼ ┤ . └ ┴ ┘}], [qw{. ┏ ┳ ┓ . ┣ ╋ ┫ . ┗ ┻ ┛}], [qw{. ┍ ┯ ┑ . ┝ ┿ ┥ . ┕ ┷ ┙}], @@ -153,31 +180,24 @@ print_glyph_tables( . ╵ │ ╎ ┆ ┊ ╷ ╿ . ╹ ┃ ╏ ┇ ┋ ╻ ╽ }], + [qw{. ╭ ╮ . ╰ ╯ }], [qw{. ╱ ╳ ╲ }], - [qw{. ╔ ╦ ╗ ═ . ╠ ╬ ╣ ║ . ╚ ╩ ╝ - }], - [qw{. ╒ ╤ ╕ . ╞ ╪ ╡ . ╘ ╧ ╛ }], - [qw{. ╓ ╥ ╖ . ╟ ╫ ╢ . ╙ ╨ ╜ }], + # ┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃╄╅╆╇╈╉╊ 'Blocks', - [qw{. ▘ ▀ ▝ . ▌ █ ▐ . ▖ ▄ ▗ }], + [qw{. □ ▣ ■ . ▤ ▦ ▥ . ▧ ▩ ▨}], [qw{. ░ . ▒ . ▓ }], + [qw{. ▘ ▀ ▝ . ▌ █ ▐ . ▖ ▄ ▗ }], [qw{. ▛ ▚ ▟ . ▙ ▞ ▜ }], [qw{. ▁ ▂ ▃ ▄ ▅ ▆ ▇ ▔ . ▏ ▎ ▍ ▌ ▋ ▊ ▉ ▕ }], - [qw{. □ ▣ ■ . ▤ ▦ ▥ . ▧ ▩ ▨}], - - 'Signs', - [qw{. ¤ ¢ ₥ € £ ₨ $ ¥ . ₫ ₭ ₦ ₱ ₧ ₮ ₩ ₪}], - [qw{. ♠ ♡ ♢ ♣ . ♤ ♥ ♦ ♧}], - [qw{. ☉ ☿ ♀ ♁ ♂ ♃ ♄ ♅ ♆ ♇}], # solar - [qw{. ♈ ♉ ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓}], # zodiac 'IPA', [qw{ - 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 - ⱱ > > ɾ ɽ - = ɢ̆ = - = @@ -190,13 +210,16 @@ print_glyph_tables( .>Click ʘ - ǀ ǁ ǃ -‼ ǂ - - = = = .>Implosive ɓ ɗ̪ > > ɗ -ᶑ ʄ ɠ ʛ = = = }], + [qw{ + co . ɕ . ʑ . ɧ . ɥ . ʍ . w + }], [( '-', 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 ɛ œ ɜ ɞ ʌ ɔ @@ -204,14 +227,7 @@ print_glyph_tables( .>Open a ɶ - - ɑ ɒ }], - 'Alphabetics', - [qw{ - .>Latin a ī ı ę ô ɳ ŋ ṡ š đ ð Ʒ - .>Cyrillic а і й э ё н њ ш щ ч ь Я - .>Greek α ί ϊ η ϋ π ψ σ ς θ ξ Ω - .>Hebrew א ײ י ע ו נ ן ס ש ט צ ץ - }], - +$verbose ? ( 'Japanese', [qw{ - A I U E O _ @@ -224,7 +240,7 @@ print_glyph_tables( .>M ま み む め も = .>Y や = ゆ = よ = .>R ら り る れ ろ = - .>W わ ゐ = ゑ を = + .>W わ -ゐ = -ゑ を = }], [qw{ - A I U E O @@ -256,20 +272,18 @@ print_glyph_tables( .>P パ ピ プ ペ ポ .>V ヷ ヸ ヴ ヹ ヺ }], +) : (), ); :>
- +
+ +
ascii + digraph + proposed + other unicode + discouraged +
+
-