unicode: mathematic (set) comparison 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         Symbols
86                 symbols/currency
87                         cards
88                         ?chess
89                         signs1
90                         communic=0?communic
91                         trinity=0?trinity
92                         signs2
93         Signs
94                         solar
95                         zodiac=0?zodiac
96         Key commands
97                 keys/spacing
98                         editing
99                         modifier
100                         control
101                         command
102                         ?player
103         Arrows
104                 arrows/single
105                         double
106                         white
107                         black
108                         block
109                         blacktri
110                         whitetri
111                         ?-large
112                         ?-heavy
113         Line drawing
114                 lines/double
115                         doubleh
116                         doublev
117                         single
118                         heavy
119                         heavyh
120                         heavyv
121                         straight
122                         curved
123                         diagonal
124         Blocks
125                 block/square
126                         shades
127                         fill4
128                         fill4i
129                         fill8
130         IPA
131                 ipa/cons
132                         consco
133                         vowels
134         ?Japanese
135                 ?japanese/hira
136                         ?hiraderiv
137                         ?kata
138                         ?kataderiv
139 });
140
141 :></div>
142
143 <div class="legend">
144         <table class="glyphs"><tr>
145         <td class="X l4">ascii
146         <td class="X l3"><:= $glyphs->{style} eq 'di' ? 'digraph' : 'latin1' :>
147         <td class="X l2"><:= $glyphs->{style} eq 'di' ? 'proposed' : 'BMP' :>
148         <td class="X l1">other unicode
149         <td class="X ex">discouraged
150         </table>
151 </div>
152
153 <script type="text/javascript" src="/clipboard.js"></script>
154