b63114cbb4c3c9e8dc6d91355d5894ae6222768d
[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         th {
53                 width: auto !important;
54         }
55
56         .sample {
57                 vertical-align: middle;
58                 text-align: left;
59                 padding: 1px 0.3em;
60         }
61         #old-roman-cursive .sample span {
62                 margin-right: -10px;
63         }
64         #tap-code .sample,
65         #short-tap .sample {
66                 font-size: 80%;
67         }
68         #ita2 .sample,
69         #tap-code .sample,
70         #short-tap .sample {
71                 word-spacing: 0;
72         }
73         #ita2 .sample span,
74         #tap-code .sample span,
75         #short-tap .sample span {
76                 margin-right: 1ex;
77                 white-space: nowrap;
78         }
79         #sutton-asl .sample span,
80         #maritime-flags .sample span,
81         #morse .sample span {
82                 margin-right: 0.5ex;
83         }
84         #pigpen .sample svg {
85                 margin-right: 0.1em;
86         }
87         #nyctographs .sample svg {
88                 background: rgba(0,0,0, .1);
89                 padding: 0.1em;
90                 margin-right: 0.2em;
91         }
92
93         svg path:not([fill]) {
94                 stroke: currentColor;
95                 fill: none;
96         }
97         svg circle:not([fill]) {
98                 fill: currentColor;
99         }
100
101         td {
102                 vertical-align: top;
103         }
104         td > svg {
105                 vertical-align: middle;
106         }
107 </style>
108
109 <h1>Latin alphabet</h1>
110
111 <p id=intro>Variant encodings of the common ASCII (latin, roman,
112 or <span title="fuck yeah!">'mercan</span>) letters A–Z.
113 Also see <a href="/writing">related alphabets</a>
114 and <a href="/chars/abc">font comparison</a>.</p>
115
116 <div>
117
118 <:
119 use List::Util qw( pairs );
120
121 my @table = do 'writing-latn.inc.pl';
122 if ($! or $@) {
123         Alert("Table data not found", $@ || $!);
124 }
125 else {
126         my %VOWELCOLS = (map { ($_ => 1) } 0, 4, 8, 14, 20, 24);
127         say '<table class="glyphs">';
128         say '<thead><tr><th># <small>ASCII − 64</small>';
129         print '<td>', $_ for 1 .. 26;
130         say '</thead>';
131
132         for my $row (pairs @table) {
133                 my ($title, $cells) = @{$row};
134                 printf '<tr id="%s">', (lc $title) =~ s/<[^>]+>//gr =~ s/\s+/-/gr;
135                 say '<th>', $title;
136                 my $colspan = 1;
137                 my $col = 0;
138                 for (@{$cells}) {
139                         $col++;
140                         if ($_ eq '>') {
141                                 $colspan++;
142                                 next;
143                         }
144                         my @class;
145                         push @class ,'l0' if $VOWELCOLS{$col - $colspan};
146                         push @class, $_ ? 'ex' : 'u-invalid' if s/^-//;
147
148                         print "\t<td";
149                         if ($col > 26) {
150                                 # special character for sample generation
151                                 print ' hidden';  # sample only
152                         }
153                         else {
154                                 print ' title=', chr($col + ord('A') - $colspan);
155                         }
156                         if ($colspan > 1) {
157                                 print " colspan=$colspan";
158                                 $colspan = 1;
159                         }
160                         printf ' class="%s"', "@class" if @class;
161                         print '>';
162                         say;
163                 }
164         }
165         say "</table>\n";
166 }
167
168 :></div>
169
170 <script type="text/javascript" src="/latinsample.js"></script>
171 <script type="text/javascript"> prependinput(document.getElementById('intro')) </script>
172