X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/d5bb14b29d37e8fdd1e4f7b44f7b548d4d0ad74d..e155b6dc4a8a43375d222c6a920a59fceb23e128:/unicode.plp diff --git a/unicode.plp b/unicode.plp index cc45d66..5b3093d 100644 --- a/unicode.plp +++ b/unicode.plp @@ -1,133 +1,147 @@ -<: -use utf8; -use strict; -use warnings; -use open IO => ':utf8'; - -our $VERSION = '1.0'; - -$header{content_type} = 'text/html; charset=utf-8'; - -:> - - - -digraph cheat sheet - - - - - - -

Common Digraphs

- -

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

+<(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 mono circus red'], + data => [qw'digraphs.inc.pl unicode.inc.pl'], +}); + +:> +

Common Unicode

+ +

+Glyphs are followed by +digraph or code point, +i^k or i^vu respectively in Vim. +

+ +
<: -my $diinfo = do 'digraphs.inc.pl'; -my %di = map { $diinfo->{$_}->[0] => $_ } grep { ref $diinfo->{$_} } - keys %$diinfo; +use 5.010; +use Shiar_Sheet::FormatChar; +my $glyphs = Shiar_Sheet::FormatChar->new; -sub quote { - local $_ = shift; - s/"/"/g; - s//>/g; - return $_; +if (exists $get{di}) { + $glyphs->{anno} = (!defined $get{di} || $get{di}) && 'di'; + $glyphs->{unicode} = 1; } - -sub table { - my ($width, $digraphs) = @_; - - my @cells; - push @cells, sprintf '%s%s', - $di{ord $_} && $diinfo->{$di{ord $_}}->[1], - $_ eq '-' ? ' ' : quote($_), - $di{ord $_} && sprintf(' %s', $di{ord $_}) - for @$digraphs; - - my @rows; - push @rows, sprintf '%s', join '', splice @cells, 0, $width, () - while @cells; - - return sprintf "%s
\n", join '', @rows; +if (exists $get{q}) { + $glyphs->{unicode} = -1; + $glyphs->{anno} = 0; } -print "

Arrows

\n\n"; -print table(@$_) for ( - [ 4 => [qw{↖ ↑ ↗ ↔ ← - → ↕ ↙ ↓ ↘ -}]], - [ 4 => [qw{⇖ ⇑ ⇗ ⇔ ⇐ - ⇒ ⇕ ⇘ ⇓ ⇙ -}]], - [ 3 => [qw{◤ ▲ ◥ ◀ ◆ ▶ ◣ ▼ ◢}]], - [ 3 => [qw{◸ △ ◹ ◁ ◇ ▷ ◺ ▽ ◿}]], -); - -print "

Line drawing

\n\n"; -print table(@$_) for ( - [ 4 => [qw{┌ ┬ ┐ ─ ├ ┼ ┤ │ └ ┴ ┘ -}]], - [ 4 => [qw{┏ ┳ ┓ ━ ┣ ╋ ┫ ┃ ┗ ┻ ┛ -}]], - [ 3 => [qw{┍ ┯ ┑ ┝ ┿ ┥ ┕ ┷ ┙}]], - [ 3 => [qw{┎ ┰ ┒ ┠ ╂ ┨ ┖ ┸ ┚}]], -# [ 4 => [qw{╔ ╦ ╗ ═ ╠ ╬ ╣ ║ ╚ ╩ ╝ -}]], -# [ 3 => [qw{╒ ╤ ╕ ╞ ╪ ╡ ╘ ╧ ╛}]], -# [ 3 => [qw{╓ ╥ ╖ ╟ ╫ ╢ ╙ ╨ ╜}]], -); - -print "

Signs

\n\n"; -print table(@$_) for ( - [ 3 => [qw{▘ ▀ ▝ ▌ █ ▐ ▖ ▄ ▗}]], - [ 3 => [qw{░ ▒ ▓ □ ▣ ■ ▤ ▦ ▥ ▧ ▩ ▨}]], - [ 4 => [qw{♠ ♡ ♢ ♣ ♤ ♥ ♦ ♧}]], - [10 => [qw{☼ ☿ ♀ ♁ ♂ ♃ ♄ ♅ ♆ ♇}]], # solar -# [12 => [qw{♈ ♉ ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓}]], # zodiac - [ 8 => [qw{¤ ¢ ₥ € £ ₨ $ ¥ ₫ ₭ ₦ ₱ ₧ ₮ ₩ ₪}]], -); - -print "

IPA

\n\n"; -print table(@$_) for ( - [12 => [qw{ - p t - ʈ - c k q - ʔ - ʡ - b d - ɖ - ɟ ɡ ɢ - - - - - m ɱ - n - ɳ ɲ ŋ ɴ - - - - ʙ - - r - - - - - - - - - - ⱱ - ɾ - ɽ - - - - - - - ɸ f θ s ʃ ʂ ç x χ ħ h ʜ - β v ð z ʒ ʐ ʝ ɣ ʁ ʕ ɦ ʢ - - - - ɬ - - - - - - - - - - - - ɮ - - - - - - - - - - ʋ - ɹ - ɻ j ɰ - - - - - - - - l - ɭ ʎ ʟ - - - - - ʘ - ǀ ǁ ǃ - ǂ - - - - - - ɓ - ɗ - - - ʄ ɠ ʛ - - - - }]], - [6 => [qw{ - i y ɨ ʉ ɯ u - - ɪ ʏ - ʊ - - e ø ɘ ɵ ɤ o - - - ə - - - - ɛ œ ɜ ɞ ʌ ɔ - æ - ɐ - - - - a ɶ - - ɑ ɒ - }]], -); +our $verbose = exists $get{v}; + +my $tables = do 'unicode.inc.pl' or die $@ || $!; + +$glyphs->print(map { + my $_ = /(.*)\?(.*)/ ? ($verbose ? $2 : $1) : $_; + if (/[A-Z]/) { + $_; + } + else { + state $group; + $group = $1 if s{^([^/]+)/}{}; + if (s/=(.*)//) { + my @select = split /=/, $1; + my $table = $tables->{$group}->{$_}; + my $rowlen; + for ($rowlen = 1; $rowlen++; $rowlen <= $#$table) { + last if $table->[$rowlen] =~ /\./; + } + my @cells = map { $_*$rowlen .. ($_+1)*$rowlen - 1 } @select; + [ @$table[@cells] ]; + } + else { + $tables->{$group}->{$_}; + } + } +} qw{ + Popular + punctuation/quoting + common + symbols/binary?symbols/binary=0 + latin/sample=0=1 + sample=2=3 + ?uncommon + punctuation/version + punctuation/marks + Symbols + symbols/currency + cards + ?chess + signs1 + communic=0?communic + trinity=0?trinity + signs2 + Signs + solar + zodiac=0?zodiac + Key commands + keys/spacing + editing + modifier + control + command + ?player + Arrows + arrows/single + double + white + black + block + blacktri + whitetri + ?-large + ?-heavy + Line drawing + lines/double + doubleh + doublev + single + heavy + heavyh + heavyv + straight + curved + diagonal + Blocks + block/square + shades + fill4 + fill4i + fill8 + IPA + ipa/cons + consco + vowels + ?Japanese + ?japanese/hira + ?hiraderiv + ?kata + ?kataderiv +}); + +:>
+ +
+ +
ascii + <:= $glyphs->{style} eq 'di' ? 'digraph' : 'latin1' :> + <:= $glyphs->{style} eq 'di' ? 'proposed' : 'BMP' :> + other unicode + discouraged +
+
+ +