2f9969a3e70dce904b9693e960e70d8f7316b969
[sheet.git] / unicode.plp
1 <(common.inc.plp)><:
2
3 Html({
4         title => 'unicode glyph cheat sheet',
5         version => 'v1.0',
6         description => [
7                 "Common Unicode characters with digraph or code point, layed out for quick location.",
8                 "Includes general symbols, arrows, drawing characters, and IPA letters.",
9         ],
10         keywords => [qw'
11                 unicode glyph char character reference common ipa symbol sign mark table digraph
12         '],
13         stylesheet => [qw'light dark mono circus red'],
14         data => [qw'digraphs.inc.pl unicode.inc.pl'],
15 });
16
17 :>
18 <h1>Common Unicode</h1>
19
20 <p>
21 Glyphs are followed by
22 <a href="/digraphs">digraph</a> or <a href="/charset">code point</a>,
23 i^k or i^vu respectively in <a href="/vi">Vim</a>.
24 </p>
25
26 <div class="diinfo">
27
28 <:
29 use 5.010;
30 use Shiar_Sheet::FormatChar;
31 my $glyphs = Shiar_Sheet::FormatChar->new;
32
33 if (exists $get{di}) {
34         $glyphs->{anno} = [ (!defined $get{di} || $get{di}) && 'di', 'hex' ];
35 }
36 if (exists $get{q}) {
37         $glyphs->{anno} = [];
38 }
39
40 our $verbose = exists $get{v};
41
42 my $tables = do 'unicode.inc.pl' or die $@ || $!;
43
44 $glyphs->print(map {
45         my $_ = /(.*)\?(.*)/ ? ($verbose ? $2 : $1) : $_;
46         if (/[A-Z]/) {
47                 $_;
48         }
49         else {
50                 state $group;
51                 $group = $1 if s{^([^/]+)/}{};
52                 if (s/=(.*)//) {
53                         my @select = split /=/, $1;
54                         my $table = $tables->{$group}->{$_};
55                         my $rowlen;
56                         for ($rowlen = 1; $rowlen++; $rowlen <= $#$table) {
57                                 last if $table->[$rowlen] =~ /\./;
58                         }
59                         my @cells = map { $_*$rowlen .. ($_+1)*$rowlen - 1 } @select;
60                         [ @$table[@cells] ];
61                 }
62                 else {
63                         $tables->{$group}->{$_};
64                 }
65         }
66 } qw{
67         Popular
68                 punctuation/quoting
69                         common
70                 symbols/binary?symbols/binary=0
71                 latin/sample=0=1
72                         sample=2=3
73                         ?uncommon
74                 punctuation/version
75                 punctuation/marks
76         Symbols
77                 symbols/currency
78                         cards
79                         ?chess
80                         signs1
81                         communic=0?communic
82                         trinity=0?trinity
83                         signs2
84         Signs
85                         solar
86                         zodiac=0?zodiac
87         Key commands
88                 keys/spacing
89                         editing
90                         modifier
91                         control
92                         command
93                         ?player
94         Arrows
95                 arrows/single
96                         double
97                         white
98                         black
99                         block
100                         blacktri
101                         whitetri
102                         ?-large
103                         ?-heavy
104         Line drawing
105                 lines/double
106                         doubleh
107                         doublev
108                         single
109                         heavy
110                         heavyh
111                         heavyv
112                         straight
113                         curved
114                         diagonal
115         Blocks
116                 block/square
117                         shades
118                         fill4
119                         fill4i
120                         fill8
121         IPA
122                 ipa/cons
123                         consco
124                         vowels
125         ?Japanese
126                 ?japanese/hira
127                         ?hiraderiv
128                         ?kata
129                         ?kataderiv
130 });
131
132 :></div>
133
134 <div class="legend">
135         <table class="glyphs"><tr>
136         <td class="X l4">ascii
137         <td class="X l3"><:= $glyphs->{style} eq 'di' ? 'digraph' : 'latin1' :>
138         <td class="X l2"><:= $glyphs->{style} eq 'di' ? 'proposed' : 'BMP' :>
139         <td class="X l1">other unicode
140         <td class="X ex">discouraged
141         </table>
142 </div>
143
144 <script type="text/javascript" src="/clipboard.js"></script>
145