unicode: logic operators
[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 if (exists $get{html}) {
40         $glyphs->{anno} = ['html', 'xml'];
41 }
42
43 our $verbose = exists $get{v};
44
45 my $tables = do 'unicode.inc.pl' or die $@ || $!;
46
47 $glyphs->print(map {
48         my $_ = /(.*)\?(.*)/ ? ($verbose ? $2 : $1) : $_;
49         if (/[A-Z]/) {
50                 $_;
51         }
52         else {
53                 state $group;
54                 $group = $1 if s{^([^/]+)/}{};
55                 if (s/=(.*)//) {
56                         my @select = split /=/, $1;
57                         my $table = $tables->{$group}->{$_};
58                         my $rowlen;
59                         for ($rowlen = 1; $rowlen++; $rowlen <= $#$table) {
60                                 last if $table->[$rowlen] =~ /\./;
61                         }
62                         my @cells = map {
63                                 my $end = (s/-(.+)?// ? ($1 // @$table / $rowlen - 1) : $_) + 1;
64                                 $_ * $rowlen .. $end * $rowlen - 1;
65                         } @select;
66                         [ @$table[@cells] ];
67                 }
68                 else {
69                         $tables->{$group}->{$_};
70                 }
71         }
72 } qw{
73         Popular
74                 punctuation/quoting
75                         common
76                 symbols/binary?symbols/binary=-5
77                 latin/sample=-1
78                         sample=2-3
79                         ?uncommon
80                 punctuation/version
81                 punctuation/marks
82                 math/size
83                         equal
84                         set
85                         logic
86         Symbols
87                 symbols/currency
88                         cards
89                         ?chess
90                         signs1
91                         communic=0?communic
92                         trinity=0?trinity
93                         signs2
94         Signs
95                         solar
96                         zodiac=0?zodiac
97         Key commands
98                 keys/spacing
99                         editing
100                         modifier
101                         control
102                         command
103                         ?player
104         Arrows
105                 arrows/single
106                         double
107                         white
108                         black
109                         block
110                         blacktri
111                         whitetri
112                         ?-large
113                         ?-heavy
114         Line drawing
115                 lines/double
116                         doubleh
117                         doublev
118                         single
119                         heavy
120                         heavyh
121                         heavyv
122                         straight
123                         curved
124                         diagonal
125         Blocks
126                 block/square
127                         shades
128                         fill4
129                         fill4i
130                         fill8
131         IPA
132                 ipa/cons
133                         consco
134                         vowels
135         ?Japanese
136                 ?japanese/hira
137                         ?hiraderiv
138                         ?kata
139                         ?kataderiv
140 });
141
142 :></div>
143
144 <div class="legend">
145         <table class="glyphs"><tr>
146         <td class="X l4">ascii
147         <td class="X l3"><:= $glyphs->{style} eq 'di' ? 'digraph' : 'latin1' :>
148         <td class="X l2"><:= $glyphs->{style} eq 'di' ? 'proposed' : 'BMP' :>
149         <td class="X l1">other unicode
150         <td class="X ex">discouraged
151         </table>
152 </div>
153
154 <script type="text/javascript" src="/clipboard.js"></script>
155