e0bb6897b9bdd09d09f626857b4fe4948c30d5d2
[sheet.git] / latin.plp
1 <(common.inc.plp)><:
2
3 Html({
4         title => 'latin alphabet cheat sheet',
5         version => '1.3',
6         description => [
7         ],
8         keywords => [qw'
9                 latin roman alphabet script letter unicode font glyph abc
10                 code encoding spelling symbol writing comparison character
11                 secret cursive fraktur blind braille morse deaf asl hand
12                 barcode bar color semaphore flag
13         '],
14         stylesheet => [qw( light dark red mono )],
15         data => ['writing-latn.inc.pl'],
16 });
17
18 :>
19 <style>
20         @font-face {
21                 font-family: Suetterlin; /* R. G. Arens */
22                 src: url("/suetterlin.ttf");
23         }
24         #sütterlin td { font-family: Suetterlin }
25         #ita2 td,
26         #tap-code td,
27         #short-tap td {
28                 white-space: normal;
29                 word-spacing: 5em; /* force line break between words */
30         }
31         #tap-code td,
32         #short-tap td {
33                 line-height: 1ex;
34         }
35         #ita2 td {
36                 font-size: 50%;
37         }
38         #cards td {
39                 font-family: Symbola, "DejaVu Sans", serif, sans;
40         }
41         #pigpen {
42                 stroke-linecap: square;
43         }
44         #nyctographs,
45         #old-roman-cursive {
46                 stroke-linecap: round;
47                 stroke-linejoin: round;
48         }
49         td {
50                 white-space: nowrap;
51         }
52
53         .sample {
54                 vertical-align: middle;
55                 text-align: left;
56                 padding: 1px 0.3em;
57         }
58         #old-roman-cursive .sample span {
59                 margin-right: -10px;
60         }
61         #tap-code .sample,
62         #short-tap .sample {
63                 font-size: 80%;
64         }
65         #ita2 .sample,
66         #tap-code .sample,
67         #short-tap .sample {
68                 word-spacing: 0;
69         }
70         #ita2 .sample span,
71         #tap-code .sample span,
72         #short-tap .sample span {
73                 margin-right: 1ex;
74                 white-space: nowrap;
75         }
76         #sutton-asl .sample span,
77         #maritime-flags .sample span,
78         #morse .sample span {
79                 margin-right: 0.5ex;
80         }
81         #pigpen .sample svg {
82                 margin-right: 0.1em;
83         }
84         #nyctographs .sample svg {
85                 background: rgba(0,0,0, .1);
86                 padding: 0.1em;
87                 margin-right: 0.2em;
88         }
89
90         svg path:not([fill]) {
91                 stroke: currentColor;
92                 fill: none;
93         }
94         svg circle:not([fill]) {
95                 fill: currentColor;
96         }
97
98         td {
99                 vertical-align: top;
100         }
101         td > svg {
102                 vertical-align: middle;
103         }
104 </style>
105
106 <h1>Latin alphabet</h1>
107
108 <p id=intro>Variant encodings of the common ASCII (latin, roman,
109 or <span title="fuck yeah!">'mercan</span>) letters A–Z.
110 Also see <a href="/writing">related alphabets</a>
111 and <a href="/chars/abc">font comparison</a>.</p>
112
113 <div>
114
115 <:
116 use List::Util qw( pairs );
117
118 my @table = do 'writing-latn.inc.pl';
119 if ($! or $@) {
120         Alert("Table data not found", $@ || $!);
121 }
122 else {
123         my %VOWELCOLS = (map { ($_ => 1) } 0, 4, 8, 14, 20, 24);
124         say '<table class="glyphs">';
125         for my $row (pairs @table) {
126                 my ($title, $cells) = @{$row};
127                 printf '<tr id="%s">', (lc $title) =~ s/<[^>]+>//gr =~ s/\s+/-/gr;
128                 say '<th>', $title;
129                 my $colspan = 1;
130                 my $col = 0;
131                 for (@{$cells}) {
132                         $col++;
133                         if ($_ eq '>') {
134                                 $colspan++;
135                                 next;
136                         }
137                         my @class;
138                         push @class ,'l0' if $VOWELCOLS{$col - $colspan};
139                         push @class, $_ ? 'ex' : 'u-invalid' if s/^-//;
140
141                         print "\t<td";
142                         if ($col > 26) {
143                                 # special character for sample generation
144                                 print ' hidden';  # sample only
145                         }
146                         else {
147                                 print ' title=', chr($col + ord('A') - $colspan);
148                         }
149                         if ($colspan > 1) {
150                                 print " colspan=$colspan";
151                                 $colspan = 1;
152                         }
153                         printf ' class="%s"', "@class" if @class;
154                         print '>';
155                         say;
156                 }
157         }
158         say "</table>\n";
159 }
160
161 :></div>
162
163 <script type="text/javascript" src="/latinsample.js"></script>
164 <script type="text/javascript"> prependinput(document.getElementById('intro')) </script>
165