latin: left-align samples; flag margins
[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'],
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         #tap-simplified td {
28                 white-space: normal;
29                 word-spacing: 5em; /* force line break between words */
30         }
31         #tap-code td,
32         #tap-simplified 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         #tap-simplified .sample {
63                 font-size: 80%;
64         }
65         #ita2 .sample,
66         #tap-code .sample,
67         #tap-simplified .sample {
68                 word-spacing: 0;
69         }
70         #ita2 .sample span,
71         #tap-code .sample span,
72         #tap-simplified .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         say '<table class="glyphs">';
124         for my $row (pairs @table) {
125                 my ($title, $cells) = @{$row};
126                 printf '<tr id="%s">', (lc $title) =~ s/<[^>]+>//gr =~ s/\s+/-/gr;
127                 say '<th>', $title;
128                 my $colspan = 1;
129                 my $col = 0;
130                 for (@{$cells}) {
131                         $col++;
132                         if ($_ eq '>') {
133                                 $colspan++;
134                                 next;
135                         }
136                         print "\t<td";
137                         if ($colspan > 1) {
138                                 print " colspan=$colspan";
139                                 $colspan = 1;
140                         }
141                         print ' hidden' if $col > 26;  # sample only
142                         print ' class=', $_ ? 'ex' : 'u-invalid' if s/^-//;
143                         print '>';
144                         say;
145                 }
146         }
147         say "</table>\n";
148 }
149
150 :></div>
151
152 <script type="text/javascript" src="/latinsample.js"></script>
153 <script type="text/javascript"> prependinput(document.getElementById('intro')) </script>
154