X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/7143ee4b4ae49ed94554c0dd29f3eea1eee51282..3f54efe157185e0ca57fc0f16fa960eca3ac4afd:/unicode.plp diff --git a/unicode.plp b/unicode.plp index 51bf7c8..4a3a086 100644 --- a/unicode.plp +++ b/unicode.plp @@ -1,20 +1,19 @@ <(common.inc.plp)><: - our $VERSION = 'v1.0'; -:> - - - - -digraph cheat sheet - - -<:= stylesheet(qw'light dark red') :> - - - - +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'], +}); + +:>

Common Unicode

i^k in Vim. @@ -23,106 +22,14 @@ Also see the complete digraphs table.

<: -my $diinfo = do 'digraphs.inc.pl'; -my %di = map { $diinfo->{$_}->[0] => $_ } grep { ref $diinfo->{$_} } - sort { length $a <=> length $b } keys %$diinfo; - -sub glyph_table { - my ($digraphs) = @_; - - my @rows; - - my @colheads; - while ($digraphs->[0] !~ /^\./) { - my $cell = shift @$digraphs or last; - push @colheads, sprintf( - '<%s%s>%s', - $cell =~ s/^-// ? 'td' : 'th', - $cell =~ s/:(.*)// ? qq{ title="$1"} : '', - $cell eq '_' ? ' ' : $cell - ); - } - push @rows, sprintf '%s', join '', @colheads if @colheads; - - my $colspan = 1; - for my $cell (@$digraphs) { - if ($cell =~ s/^\.//) { - # dot indicates start of a new row - push @rows, ''; - if ($cell =~ s/^>//) { - # header cell text follows - $cell =~ s/_/ /g; # underscores may be used instead of whitespace (for qw//ability) - $rows[-1] .= ''.($cell || ' '); - } - next; - } - elsif ($cell eq '>') { - # merge this cell to the next column - $colspan++; - next; - } - - my ($code, $name); - - # determine display class - my @class; - if ($cell eq '-') { - $cell = ''; - } - elsif ($cell eq '=') { - push @class, 'di-invalid'; - $cell = ''; - } - else { - 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/; - } - elsif (defined $name) { - push @class, 'X'; - } - - 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"} : '', - @class ? sprintf(' class="%s"', join ' ', @class) : '', - $colspan > 1 && qq{ colspan="$colspan"}, - $cell eq '' ? ' ' : EscapeHTML($cell), - defined $code ? sprintf(' %s', EscapeHTML($code)) - : length($cell) == 1 && $cell !~ /[a-z]/ - ? sprintf(' %04X', 'value', ord $cell) - : '', - ); - - $colspan = 1; - } - - return sprintf qq{\n%s
\n}, - join '', map {"$_\n"} @rows; -} +use Shiar_Sheet::FormatChar; +my $glyphs = Shiar_Sheet::FormatChar->new; sub print_glyph_tables { while (@_) { printf '

%s

'."\n\n", shift; while (ref $_[0] and $_ = shift) { - print glyph_table($_); + print $glyphs->table($_); } print '
'; } @@ -134,16 +41,30 @@ print_glyph_tables( 'Popular', [qw{. « » . ‹ › . ‘ ’ . “ ” . „ ‚ . ‟ ‛}], [qw{. † ‡ • . § ¶ # . © ® ™ . ° ′ ″ . − × ÷ . ± ² √}], - [qw{. ⚋ ⚊ . ⚐ ⚑ . ☺ ☹ . ✓ ✗ . ✔ ✘ . ◄ ► }], + [qw{. ⚋ ⚊ . ⚐ ⚑ . ☺ ☹ . ✓ ✗ . ✔ ✘ }], [qw{. å ä ö ü ß . ā æ ø ű ſ}], - [qw{. ¿ ç ñ é ê è}], - [qw{. α β}], [qw{. א}], + [qw{. ñ ç é ê è . ŋ č ų ŭ ů }], + [qw{. ¿ … 〃 ‐ – . ‽ · ※ ‒ — }], + [qw{. α β}], - 'Signs', - [qw{. ¤ ¢ ₥ € £ ₨ $ ¥ . ₫ ₭ ₦ ₱ ₧ ₮ ₩ ₪}], + 'Symbols', + [qw{. ¤ ¢ ₥ € £ ₨ $ ¥ . ฿ ₫ ₭ ₦ ₱ ₮ ₩ ₪}], [qw{. ♠ ♡ ♢ ♣ . ♤ ♥ ♦ ♧}], + [qw{. ☮ ☯ ☻ ♪ ♲ ♿ }], + [qw{. ✂ ✉ ☎ }], [qw{. ⚠ ☡ ☠}], + 'Signs', [qw{. ☉ ☿ ♀ ♁ ♂ ♃ ♄ ♅ ♆ ♇}], # solar - [qw{. ♈ ♉ ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓}], # zodiac + [qw{ + . ♈ ♉ ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓ + . 寅 卯 辰 巳 午 未 申 酉 戌 亥 子 丑 + }], # zodiac + + 'Key commands', + [qw{. ⇥ ⇤ . ␣ ⌫ }], # common spacing + [qw{. ⎀ ⇱ ⇞ . ⌦ ⇲ ⇟ }], # edit block + [qw{. ⇪ ⇯ ⇭ . ⇧ ⇮ № }], # modifier + [qw{. ⎈ ⌥ ⌘ ⎄ }], [qw{. ↵ ⎋ ⎉ ⎊ }], # command + [qw{. ► ⏩ ⏭ ◼ ⚫ . ◄ ⏪ ⏮ ⏏ -❚❚ }], # player ui 'Arrows', [qw{. ↖ ↑ ↗ ↔ . ← - → ↕ . ↙ ↓ ↘ -}], @@ -172,7 +93,9 @@ $verbose ? ( . ╵ │ ╎ ┆ ┊ ╷ ╿ . ╹ ┃ ╏ ┇ ┋ ╻ ╽ }], + [qw{. ╭ ╮ . ╰ ╯ }], [qw{. ╱ ╳ ╲ }], + # ┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃╄╅╆╇╈╉╊ 'Blocks', [qw{. □ ▣ ■ . ▤ ▦ ▥ . ▧ ▩ ▨}], @@ -201,7 +124,7 @@ $verbose ? ( .>Implosive ɓ ɗ̪ > > ɗ -ᶑ ʄ ɠ ʛ = = = }], [qw{ - co . ɕ . ʑ . ɧ . ɥ . ʍ . w + - co:coarticulated .>sç ɕ .>zʝ ʑ .>ʃx ɧ .>jʷ ɥ .>hw̥ ʍ .>ɰʷ w }], [( '-', @@ -277,14 +200,3 @@ $verbose ? (
- - -