-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
472 lines (401 loc) · 16.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="favicon.ico">
<title>Good sans-serif fonts</title>
<style>
@font-face {
font-family: 'Atkinson Hyperlegible';
src: url(Atkinson-Hyperlegible-Regular-102.otf);
}
@font-face {
font-family: 'Atkinson Hyperlegible';
src: url(Atkinson-Hyperlegible-Bold-102.otf);
font-weight: bold;
}
@font-face {
font-family: 'Atkinson Hyperlegible';
src: url(Atkinson-Hyperlegible-Italic-102.otf);
font-style: italic
}
@font-face {
font-family: 'Atkinson Hyperlegible';
src: url(Atkinson-Hyperlegible-BoldItalic-102.otf);
font-weight: bold;
font-style: italic
}
@font-face {
font-family: 'Go';
src: url(Go-Regular.ttf);
}
@font-face {
font-family: 'Go';
src: url(Go-Bold.ttf);
font-weight: bold;
}
@font-face {
font-family: 'Go';
src: url(Go-Italic.ttf);
font-style: italic
}
@font-face {
font-family: 'Go';
src: url(Go-Bold-Italic.ttf);
font-weight: bold;
font-style: italic
}
@font-face {
font-family: 'IBM Plex Sans';
src: url(IBMPlexSans-Regular.otf);
}
@font-face {
font-family: 'IBM Plex Sans';
src: url(IBMPlexSans-Bold.otf);
font-weight: bold;
}
@font-face {
font-family: 'IBM Plex Sans';
src: url(IBMPlexSans-Italic.otf);
font-style: italic
}
@font-face {
font-family: 'IBM Plex Sans';
src: url(IBMPlexSans-BoldItalic.otf);
font-weight: bold;
font-style: italic
}
@font-face {
font-family: 'Recursive Sans Casual';
src: url(RecursiveSansCslSt-Regular.ttf);
}
@font-face {
font-family: 'Recursive Sans Casual';
src: url(RecursiveSansCslSt-Bold.ttf);
font-weight: bold;
}
@font-face {
font-family: 'Recursive Sans Casual';
src: url(RecursiveSansCslSt-Italic.ttf);
font-style: italic
}
@font-face {
font-family: 'Recursive Sans Casual';
src: url(RecursiveSansCslSt-BdItalic.ttf);
font-weight: bold;
font-style: italic
}
@font-face {
font-family: 'Recursive Sans Linear';
src: url(RecursiveSansLnrSt-Regular.ttf);
}
@font-face {
font-family: 'Recursive Sans Linear';
src: url(RecursiveSansLnrSt-Bold.ttf);
font-weight: bold;
}
@font-face {
font-family: 'Recursive Sans Linear';
src: url(RecursiveSansCslSt-Italic.ttf);
font-style: italic
}
@font-face {
font-family: 'Recursive Sans Linear';
src: url(RecursiveSansLnrSt-BoldItalic.ttf);
font-weight: bold;
font-style: italic
}
@font-face {
font-family: 'Source Sans 3';
src: url(SourceSans3-Regular.otf);
}
@font-face {
font-family: 'Source Sans 3';
src: url(SourceSans3-Bold.otf);
font-weight: bold;
}
@font-face {
font-family: 'Source Sans 3';
src: url(SourceSans3-It.otf);
font-style: italic
}
@font-face {
font-family: 'Source Sans 3';
src: url(SourceSans3-BoldIt.otf);
font-weight: bold;
font-style: italic
}
body {
margin: 0;
font-size: larger;
overflow: hidden;
}
div {
display: flex;
flex-flow: column;
height: 100vh;
}
a {
color: inherit;
text-decoration-color: #777
}
header a,
footer a {
color: #777;
text-decoration: none;
}
header {
display: flex;
flex-wrap: wrap;
flex: 0 1 auto;
border-bottom: 1px solid #777;
line-height: 2em;
}
header * {
display: inline-block
}
header a {
position: absolute;
font-size: x-large;
top: 0;
right: 0;
padding: 0em 0.5em
}
header label {
cursor: pointer;
user-select: none;
padding: 0 1em;
width: 13em;
}
label i {
border: 1px solid currentColor;
width: 3ex;
height: 1.5ex;
border-radius: 1em
}
label b {
background: #777;
width: 1.5ex;
height: 1.5ex;
border-radius: 1em;
transition: margin-left 0.15s
}
header section {
display: flex;
flex-wrap: wrap;
}
article {
flex: 1 1 auto;
overflow-y: auto;
overflow-x: hidden;
padding: 0 1em;
}
:root {
--a: #000;
--b: #fff
}
.tl {
display: none
}
.td {
display: inline
}
@media (prefers-color-scheme: light) {
:root {
--a: #fff;
--b: #000;
}
.tl {
display: inline
}
.td {
display: none
}
}
.d {
background: var(--a);
color: var(--b)
}
#t:checked~div,
#t:checked~div header {
background: var(--b);
color: var(--a)
}
#t:focus~div [for=t],
#c:focus~div [for=c],
#w:focus~div [for=w],
#s:focus~div [for=s],
:focus {
outline: 1px dotted currentColor
}
#t:focus~div [for=t] b,
#c:focus~div [for=c] b,
#w:focus~div [for=w] b,
#s:focus~div [for=s] b {
background: currentColor
}
a:focus {
color: currentColor;
text-decoration-color: currentColor;
}
#c:not(:checked)~div {
filter: invert(0.2)
}
#w:checked~div article {
font-weight: bold
}
#s:checked~div article {
font-style: italic
}
#t:checked~div [for=t] b,
#c:checked~div [for=c] b,
#w:checked~div [for=w] b,
#s:checked~div [for=s] b {
margin-left: .75em;
}
#fx:checked~div article {
font-family: sans-serif;
}
#fh:checked~div article {
font-family: 'Atkinson Hyperlegible';
}
#fg:checked~div article {
font-family: 'Go';
}
#fi:checked~div article {
font-family: 'IBM Plex Sans';
}
#frc:checked~div article {
font-family: 'Recursive Sans Casual';
}
#frl:checked~div article {
font-family: 'Recursive Sans Linear';
}
#fs:checked~div article {
font-family: 'Source Sans 3';
}
body,
blockquote:first-child {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
input {
position: absolute;
z-index: -1
}
h1 {
text-align: center
}
h2,
h3 {
font-weight: unset
}
h3 {
margin-bottom: 0.25em
}
h3~p {
margin-top: 0
}
.m {
font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "Ubuntu Mono", "Roboto Mono", "Menlo", "Monaco", "Consolas", monospace;
}
blockquote {
font-size: larger;
cursor: pointer;
display: inline-block;
}
blockquote:after {
display: inline;
white-space: pre-wrap;
content: attr(style)"\a| Il1 & O0o $#!+? () [] {} — – -0123456789%\a'WALTZ, BAD NYMPH; FOR QUICK JIGS VEX.'\a@ \"waltz, bad nymph; for quick jigs vex.\""
}
footer {
padding: 1em
}
article section {
text-align: center
}
</style>
</head>
<body>
<input tabindex="1" type="checkbox" id="t">
<input tabindex="2" type="checkbox" id="c">
<input tabindex="3" type="checkbox" id="w">
<input tabindex="4" type="checkbox" id="s">
<input tabindex="5" type="radio" name="f" id="fy">
<input tabindex="15" type="radio" name="f" id="fx">
<input type="radio" name="f" id="fh">
<input type="radio" name="f" id="fg">
<input type="radio" name="f" id="fi">
<input type="radio" name="f" id="frc">
<input type="radio" name="f" id="frl">
<input type="radio" name="f" id="fs">
<div class="d">
<header class="d">
<section>
<label for="t">Theme: <span><span class="td">dark</span><span class="tl">light</span> <i><b></b></i> <span class="td">light</span><span class="tl">dark</span></span></label>
<label for="c">Contrast: <span>low <i><b></b></i> high</span></label>
</section>
<section>
<label for="w">Weight: <span>normal <i><b></b></i> bold</span></label>
<label for="s">Style: <span>normal <i><b></b></i> italic</span></label>
</section>
<a tabindex="6" href="https://github.com/abrudz/sans" target="_blank">♥</a>
</header>
<article tabindex=7>
<noscript><h1>This site uses absolutely no scripts or trackers.<br>You can <a href="https://github.com/abrudz/sans" target="_blank">check the source</a> to verify this.<br>However, custom webfonts are essential to its purpose.<br>It therefore cannot function when <span class="m">noscript</span> is enabled.</h1></noscript>
<h2 id="h1">Good sans-serif fonts</h2>
<p>What makes a sans-serif font good?</p>
<ul>
<li>Context-free recognition of “I” (capital “eye”) and “l” (lowercase “ell”) and “1” (digit one)</li>
<li>Context-free recognition of “O” (capital “oh”) and “0” (digit zero) and “o” (lowercase “oh”)</li>
<li>Availability of at least normal, <b>bold</b>, <i>italic</i>, and <b><i>bold italic</i></b> for formatting flexibility
</li>
<li>Permissive licensing (libre; free as in speech) to prevent legal issues during use</li>
</ul>
<h3>Background</h3>
<p>Many fonts render “I” (capital “eye”) practically identical to “l” (lowercase “ell”), or “l” (lowercase “ell”) practically identical to “1” (digit one). Even those fonts that have three distinct glyphs, tend to let either “I” (capital “eye”)
or “l” (lowercase “ell”) be a non-descript tall rectangle, meaning that the reader needs to know the font well, to determine which character the glyph represents. The problem is even worse if a text contains any “|” (vertical pipe) Similarly,
many fonts have a “0” (digit zero) which is either identical to, or a narrower variant of “O” (capital “oh”), or have “0” (digit zero) virtually identical to “o” (lowercase “oh”). Again, without familiarity, or comparing “O” (capital “oh”)
and “0” (digit zero) side-by-side, it can be hard to tell which is which. These problems exist with almost all sans-serif fonts today. A historical overview is given by Charles Bigelow in
<a tabindex="8" href="https://www.tug.org/TUGboat/tb34-2/tb107bigelow-zero.pdf" target="_blank">Oh, oh, zero!</a>.
</p>
<h3>A solution</h3>
<p>To enable instant recognition of each character, “I” (capital “eye”) must be fitted with slab-serifs (horizontal bars), while “l” (lowercase “ell”) gets a finial, “1” (digit one) maintains a prominent slanted top serif, and “0” (digit zero)
has an inner slash or dot. Incidentally, this also avoids any confusion with “|” (vertical bar). While this may be obvious, very few fonts in fact do this. The only ones I’ve found living up to all the above requirements are (with links
to repositories):
</p>
<ul>
<li><a tabindex="9" href="https://github.com/googlefonts/atkinson-hyperlegible/tree/main/fonts" target="_blank">Atkinson Hyperlegible</a> (grotesque)</li>
<li><a tabindex="10" href="https://go.googlesource.com/image/+/master/font/gofont/" target="_blank">Go</a> (humanist)</li>
<li><a tabindex="11" href="https://github.com/IBM/plex/" target="_blank">IBM Plex Sans<sup>1</sup></a> (grotesque)</li>
<li><a tabindex="12" href="https://github.com/arrowtype/recursive/tree/main/fonts/recursive_for_googlefonts/static" target="_blank">Recursive Sans Casual<sup>1</sup></a> (cursive)</li>
<li><a tabindex="13" href="https://github.com/arrowtype/recursive/tree/main/fonts/recursive_for_googlefonts/static" target="_blank">Recursive Sans Linear<sup>1</sup></a> (slab-serif)</li>
<li><a tabindex="14" href="https://github.com/adobe-fonts/source-sans" target="_blank">Source Sans 3<sup>2</sup></a> (grotesque/humanist)</li>
</ul>
<p>Notes:</p>
<ol>
<li>Requires <span class="m">font-feature-settings: 'zero'</span> for slashed “0” (digit zero).</li>
<li>Requires <span class="m">font-feature-settings: 'ss01', 'zero'</span> for barred “I” (capital “eye”) and slashed “0” (digit zero).</li>
</ol>
<p>Some editors do not allow choosing font features, which makes even these fonts inadequate.</p>
<h3>Font samples</h3>
<p>Click on a sample to make generic text on this page use that font:</p>
<section>
<label for="fy"><blockquote>Your system UI font</blockquote></label>
<label for="fx"><blockquote style="font-family: sans-serif"></blockquote></label>
<label for="fh"><blockquote style="font-family: 'Atkinson Hyperlegible'"></blockquote></label>
<label for="fg"><blockquote style="font-family: 'Go'"></blockquote></label>
<label for="fi"><blockquote style="font-family: 'IBM Plex Sans';
font-feature-settings: 'zero'"></blockquote></label>
<label for="frc"><blockquote style="font-family: 'Recursive Sans Casual';
font-feature-settings: 'zero'"></blockquote></label>
<label for="frl"><blockquote style="font-family: 'Recursive Sans Linear';
font-feature-settings: 'zero'"></blockquote></label>
<label for="fs"><blockquote style="font-family: 'Source Sans 3';
font-feature-settings: 'ss01', 'zero'"></blockquote></label>
<footer><small>Made with <a href="https://github.com/abrudz/sans" target="_blank">♥</a> using plain HTML and CSS ― absolutely no JavaScript.</small></footer>
</section>
</article>
</div>
</body>
</html>