-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubordinate-latin.html
605 lines (493 loc) · 22.4 KB
/
subordinate-latin.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
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description"
content="Japanese typeface designers call the Latin script section of their projects the 'Subordinate Latin'. What does it look like?">
<meta name="og:title" content="Subordinate Latin - The Latin inside Japanese fonts">
<meta name="og:image" content="https://maxbo.me/img/comparison.png">
<meta name="og:description"
content="Japanese typeface designers call the Latin script section of their projects the 'Subordinate Latin'. What does it look like?">
<meta name="keywords" content="Japanese, Typeface, Latin, Subordinate Latin, Fonts, Typography">
<meta name="author" content="Max Bo">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@_max_bo_">
<meta name="twitter:title" content="Subordinate Latin - The Latin inside Japanese fonts">
<meta name="twitter:description"
content="Japanese typeface designers call the Latin script section of their projects the 'Subordinate Latin'. What does it look like?">
<meta name="twitter:image" content="https://maxbo.me/img/comparison.png">
<meta property="og:type" content="website">
<meta property="og:url" content="https://maxbo.me/subordinate-latin.html">
<meta property="og:site_name" content="Max Bo">
<title>Subordinate Latin - The Latin inside Japanese fonts</title>
<script>
(function (d) {
var config = {
kitId: 'eun4uzv',
scriptTimeout: 3000,
async: true
},
h = d.documentElement, t = setTimeout(function () { h.className = h.className.replace(/\bwf-loading\b/g, "") + " wf-inactive"; }, config.scriptTimeout), tk = d.createElement("script"), f = false, s = d.getElementsByTagName("script")[0], a; h.className += " wf-loading"; tk.src = 'https://use.typekit.net/' + config.kitId + '.js'; tk.async = true; tk.onload = tk.onreadystatechange = function () { a = this.readyState; if (f || a && a != "complete" && a != "loaded") return; f = true; clearTimeout(t); try { Typekit.load(config) } catch (e) { } }; s.parentNode.insertBefore(tk, s)
})(document);
</script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Sawarabi+Mincho&family=Shippori+Mincho&family=Zen+Old+Mincho&family=Hina+Mincho&family=Zen+Old+Mincho&family=Noto+Sans+JP&family=Noto+Serif+JP&family=BIZ+UDMincho&display=swap');
h1 {
font-size: 4em;
font-weight: normal;
padding: 0px;
margin: 5px;
}
a:hover {
text-decoration-thickness: 3px;
}
a:active {
background-color: yellow;
text-underline-offset: 4px;
}
a:target {
background-color: yellow;
}
b,
strong {
text-decoration: underline;
}
@media (max-width: 768px) {
h1 {
font-size: calc(3em);
}
}
html,
body {
font-family: 'source-han-serif-japanese', 'SimSun', 'MS Mincho', 'Hiragino Mincho ProN', serif;
}
/* @font-face {
font-family: 'Kuromi Dingbats';
src: url('fonts/KuromiDingbats.ttf') format('truetype');
} */
@font-face {
font-family: 'Hello Kitty';
src: url('fonts/HelloKitty.otf') format('opentype');
}
.preview {
font-size: 2em;
white-space: pre-wrap;
}
body {
padding-left: 16px;
padding-right: 16px;
/* max-width: 800px;
margin: 0 auto; */
}
.maxwidth {
max-width: 800px;
margin: 0 auto;
}
.full-width {
font-variant-east-asian: full-width;
font-feature-settings: 'fwid';
}
.half-width {
font-feature-settings: 'hwid';
}
blockquote {
border-left: 1px dotted #000;
padding-left: 15px;
margin-left: 15px;
}
p {
margin-top: 0;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
tr {
border: 1px solid #6c6c6c;
}
th,
td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}
th:first-child,
td:first-child {
width: 200px;
background-color: #fff7f2;
}
th:nth-child(2),
td:nth-child(2) {
width: 100px;
background-color: #f0fbff;
}
.control {
background-color: #f2f2f2;
}
select {
max-width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
select option {
max-width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
q {
quotes: "「" "」" "『" "』";
}
q::before {
content: open-quote;
}
q::after {
content: close-quote;
}
figure {
padding: 0;
margin: 0;
}
@media (max-width: 600px) {
table,
th,
td {
display: block;
width: 100%;
}
th,
td {
box-sizing: border-box;
}
th:first-child {
width: 100%;
}
td:first-child {
width: 100%;
}
th:nth-child(2) {
width: 100% !important;
}
td:nth-child(2) {
width: 100% !important;
}
}
</style>
</head>
<body></body>
<div class="maxwidth"
style="position: sticky; top: 0; background-color: rgba(255, 255, 255, 0.681); padding: 10px; border-bottom: 1px solid #ddd; z-index: 1000;">
<label for="font-selector">Choose a font:</label>
<select id="font-selector"></select>
</div>
<main>
<div class="maxwidth">
<div style="padding-top: 16px;">
<a href="index.html">← max bo</a>
</div>
<header>
<h1><q>Subordinate Latin</q></h1>
<p>September 26 2024</p>
</header>
<blockquote>
<b>The Latin inside Japanese fonts</b>
<br />
<br />
Japanese typeface designers call the Latin script section of their projects the “Subordinate Latin.” The typical
Latin typeface has glyphs with varying proportional widths, but Kanji are designed to fit within a square space
which means they are much wider than most Latin letterforms. This means a typical Latin font will look much too
narrow when mixed in among Japanese characters. To allow Latin to blend with the other scripts in Japanese text,
Latin letterforms are modified to be slightly wider and have shorter <a
href="https://fonts.google.com/knowledge/glossary/ascenders_descenders">ascenders and descenders</a> and
bigger
<a href="https://fonts.google.com/knowledge/glossary/counter">counters</a>.
In addition to this adjusted Latin, [some] Japanese fonts also include a <a
href="https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms">“full width”</a> Latin design.
<br />
<br />
<figure>
<img style="width: 100%; max-width: 600px;" src="img/comparison.png"
alt="“Hello Type” set in Shippori Mincho Subordinate Latin vs. Times New Roman">
<figcaption>Japanese Subordinate Latin (top) compared to Times New Roman (bottom)</figcaption>
</figure>
</blockquote>
~ <a href="https://fonts.googleblog.com/2021/10/say-hello-to-our-big-new-japanese.html"><cite>Say Hello to our
preview new Japanese collection with Zen Fonts: Learn about the complex beauty of Japanese fonts</cite></a> by
Min-Young Kim
<p style="border: 1px dotted black; padding: 32px; margin: 32px">
i really fw the look of <q>Subordinate Latin</q> so i thought i'd compile a collection of fonts that feature it
</p>
<center>▼▼▼</center>
<br />
<h2>Type tester</h2>
<p>❗ If you see <span style="font-family: 'Hello Kitty', Webdings">dingbats</span>, then the font is either
unavailable on your platform or has failed to load.</p>
<textarea id="tester" rows="3" style="width: 100%">Sphinx of black quartz, judge my vow.</textarea>
<script type="module">
</script>
<small>
Jump to:
<a href="#fullwidth-forms">Fullwidth forms</a>,
<a href="#halfwidth-forms">Halfwidth forms</a>
</small>
</div>
<table>
<thead>
<tr>
<th>Font</th>
<th>Platform</th>
<th>Test</th>
</tr>
</thead>
<tbody id="font-table-body">
</tbody>
</table>
<div class="maxwidth">
<h3 id="fullwidth-forms"><a href="#fullwidth-forms">#</a> Fullwidth forms</h3>
<p>So that mixed-Latin/<a href="https://en.wikipedia.org/wiki/CJK_characters">CJK</a> text is visually
<q>harmonious</q>
some fonts have <a href="https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms">Latin fullwidth forms</a>,
matching the width of CJK characters.
They are rendered by either enabling the <a
href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-east-asian"><code>font-variant-east-asian: full-width</code></a>
or <a
href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-feature-settings"><code>font-feature-settings: 'fwid'</code></a>
CSS properties, or by using <a
href="https://en.wikipedia.org/wiki/Halfwidth_and_Fullwidth_Forms_(Unicode_block)">Halfwidth and Fullwidth
Forms</a> Unicode <a href="https://en.wikipedia.org/wiki/Code_point">code points</a>.
<p>Like monospace fonts, fullwidth characters occupy the same horizontal space regardless of their natural width.
<p><b>Unlike</b> true monospace fonts, <code>full-width</code> only affects certain characters (mainly <a
href="https://en.wikipedia.org/wiki/ASCII">ASCII character set</a> letters, numbers, and punctuation), so it
doesn't guarantee that all characters in the text will have the same width.</p>
<button class="strip" onclick="stripHelloWorld()">Hide 'Hello, world!'</button>
</div>
<table>
<thead>
<tr>
<th>Font</th>
<th>Platform</th>
<th>Test</th>
</tr>
</thead>
<tbody id="font-table-body-fullwidth">
</tbody>
</table>
<div class="maxwidth">
<h3 id="halfwidth-forms"><a href="#halfwidth-forms">#</a> Halfwidth forms</h3>
<p>Some fonts also support a <a href="https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms">halfwidth</a>
variant, rendered by either enabling the <a
href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-feature-settings"><code>font-feature-settings: 'hwid'</code></a>
CSS property, or by using <a
href="https://en.wikipedia.org/wiki/Halfwidth_and_Fullwidth_Forms_(Unicode_block)">Halfwidth and Fullwidth
Forms</a> Unicode <a href="https://en.wikipedia.org/wiki/Code_point">code points</a>.</p>
<button class="strip" onclick="stripHelloWorld()">Hide 'Hello, world!'</button>
</div>
<table>
<thead>
<tr>
<th>Font</th>
<th>Platform</th>
<th>Test</th>
</tr>
</thead>
<tbody id="font-table-body-halfwidth">
</tbody>
</table>
<div class="maxwidth">
<h2>Form support table</h2>
<table>
<thead>
<tr>
<th>Font</th>
<th>Platform</th>
<th><a href="#fullwidth-forms">Fullwidth</a></th>
<th><a href="#halfwidth-forms">Halfwidth</a></th>
</tr>
</thead>
<tbody id="font-table-body-support">
</tbody>
</table>
<div style="border: 1px dotted black; padding: 32px; margin: 32px">
honestly i really think that <a href="#Source Han Serif">Source Han Serif</a> looks the "cleanest" <i>and</i> is available free on Adobe Fonts (and <a href="#Noto Serif JP">Google Fonts</a><sup><a href="#[c]">[c]</a></sup>)
<br />
<br />
special mention to <a href="#Hiragino Mincho ProN">Hiragino Mincho ProN</a> which is really quite pretty, and the general goofiness of <a href="#SimSun">SimSun</a> and <a href="#MS Mincho">MS Mincho</a>
</div>
<a id="[a]" href="#[a]"><sup>[a]</sup></a> This is the article's <code><body></code> font stack. <a
href="#ref[a]">⤣</a>
<br />
<a id="[b]" href="#[b]"><sup>[b]</sup></a> A <q>typical Latin font</q> for comparison. <a href="#ref[b]">⤣</a>
<br />
<a id="[c]" href="#[c]"><sup>[c]</sup></a>
Note that Noto [<a href="#Noto Serif JP">Serif</a>|<a href="#Noto Sans JP">Sans</a>] JP is just
the Google Font version of Source Han [<a href="#Source Han Serif">Serif</a>|<a href="#Source Han Sans">Sans</a>],
but as it's a Google Font, doesn't include <code>font-variant-east-asian: full-width</code> /
<code>font-feature-settings: 'fwid'</code> or <code>font-feature-settings: 'hwid'</code> . <a href="#ref[c]">⤣</a>
<br />
<a id="[d]" href="#[d]"><sup>[d]</sup></a>
Unlike all other listed fonts, Noto <a href="#Noto Serif JP">Serif</a>|<a href="#Noto Sans JP">Sans</a> JP's CJK characters remain fullwidth
with the application of <code>font-feature-settings: 'hwid'</code>. Odd. <a href="#ref[d]">⤣</a>
<br />
<footer style="padding-top: 32px; padding-bottom: 32px;">
<a href="https://github.com/MaxwellBo/maxwellbo.github.io/blob/master/subordinate-latin.html">Submit more
fonts?</a>
</footer>
</div>
</main>
<script>
const fonts = [
{ fontFamily: "'source-han-serif-japanese', 'SimSun', 'MS Mincho', 'Hiragino Mincho ProN'", platform: "multiplatform", style: "serif", notes: ['a'] },
{ fontFamily: 'Times New Roman', platform: 'multiplatform', style: 'serif', control: true, link: "https://learn.microsoft.com/en-us/typography/font-list/times-new-roman", notes: ['b'] },
{ name: "Source Han Serif", fontFamily: "source-han-serif-japanese", platform: "Adobe Fonts", style: "serif", link: "https://source.typekit.com/source-han-serif", supportsFullWidth: true, supportsHalfWidth: true, notes: ['c', 'd'] },
{ fontFamily: "SimSun", platform: "Windows", style: "serif", link: "https://learn.microsoft.com/en-us/typography/font-list/simsun" },
{ fontFamily: "MS Mincho", platform: "Windows", style: "serif", link: "https://learn.microsoft.com/en-us/typography/font-list/ms-mincho" },
{ fontFamily: "Noto Serif JP", platform: "Google Fonts / Android", style: "serif", link: "https://fonts.google.com/noto/specimen/Noto+Serif+JP", supportsFullWidth: false, supportsHalfWidth: false, notes: ['c'] },
{ fontFamily: "Hina Mincho", platform: "Google Fonts", style: "serif", link: "https://fonts.google.com/specimen/Hina+Mincho" },
{ fontFamily: "Sawarabi Mincho", platform: "Google Fonts", style: "serif", link: "https://fonts.google.com/specimen/Sawarabi+Mincho" },
{ fontFamily: "Shippori Mincho", platform: "Google Fonts", style: "serif", link: "https://fonts.google.com/specimen/Shippori+Mincho" },
{ fontFamily: "Zen Old Mincho", platform: "Google Fonts", style: "serif", link: "https://fonts.google.com/specimen/Zen+Old+Mincho" },
{ fontFamily: "BIZ UDMincho", platform: "Google Fonts", style: "serif", link: "https://fonts.google.com/specimen/BIZ+UDMincho" },
{ fontFamily: "Hiragino Mincho ProN", platform: "MacOS, iOS", style: "serif", supportsFullWidth: true, supportsHalfWidth: true },
{ fontFamily: "YuMincho", platform: "MacOS", style: "serif", supportsFullWidth: true, supportsHalfWidth: true },
{ fontFamily: "Toppan Bunkyu Gothic", platform: "MacOS", style: "serif", supportsFullWidth: true, supportsHalfWidth: true },
{ fontFamily: "Toppan Bunkyu Mincho", platform: "MacOS", style: "serif", supportsFullWidth: true, supportsHalfWidth: true },
{ fontFamily: "Toppan Bunkyu Midashi Mincho", platform: "MacOS", style: "serif", supportsFullWidth: true, supportsHalfWidth: true },
{ fontFamily: "Tsukushi B Round Gothic", platform: "MacOS", style: "serif", supportsFullWidth: true, supportsHalfWidth: true },
{ fontFamily: 'Arial', platform: 'multiplatform', style: 'sans serif', control: true, link: "https://learn.microsoft.com/en-us/typography/font-list/arial", notes: ['b'] },
{ name: "Source Han Sans", fontFamily: "source-han-sans-japanese", platform: "Adobe Fonts", style: "sans serif", link: "https://source.typekit.com/source-han-serif", supportsFullWidth: true, supportsHalfWidth: true, notes: ['c', 'd'] },
{ fontFamily: "MS PGothic", platform: "Windows", style: "sans serif", link: "https://learn.microsoft.com/en-us/typography/font-list/ms-pgothic" },
{ fontFamily: "Meiryo", platform: "Windows", style: "sans serif", supportsFullWidth: true, supportsHalfWidth: true, link: "https://learn.microsoft.com/en-us/typography/font-list/meiryo" },
{ fontFamily: "Noto Sans JP", platform: "Google Fonts / Android", style: "sans serif", link: "https://fonts.google.com/noto/specimen/Noto+Sans+JP", supportsFullWidth: false, supportsHalfWidth: false, notes: ['c'] },
{ fontFamily: "Osaka", platform: "MacOS", style: "sans serif" },
{ fontFamily: "Hiragino Kaku Gothic Pro", platform: "MacOS, iOS", style: "sans serif", supportsFullWidth: true, supportsHalfWidth: true },
{ fontFamily: "Hiragino Maru Gothic ProN", platform: "MacOS, iOS", style: "sans serif", supportsFullWidth: true, supportsHalfWidth: true },
{ fontFamily: "Hiragino Sans", platform: "MacOS, iOS", style: "sans serif", supportsFullWidth: true, supportsHalfWidth: true },
{ fontFamily: "Toppan Bunkyu Midashi Gothic", platform: "MacOS", style: "sans serif", supportsFullWidth: true, supportsHalfWidth: true },
{ fontFamily: "Tsukushi A Round Gothic", platform: "MacOS", style: "sans serif", supportsFullWidth: true, supportsHalfWidth: true },
{ fontFamily: "YuKyokasho Yoko", platform: "MacOS", style: "sans serif", supportsFullWidth: true, supportsHalfWidth: true },
{ fontFamily: "Klee", platform: "MacOS", style: "sans serif", supportsFullWidth: true, supportsHalfWidth: true },
];
const fontSelector = document.getElementById('font-selector');
let currentStyle = '';
for (const font of fonts) {
if (font.control) continue;
if (font.style !== currentStyle) {
const disabledOption = document.createElement('option');
disabledOption.disabled = true;
disabledOption.textContent = font.style.toUpperCase();
fontSelector.appendChild(disabledOption);
currentStyle = font.style;
}
const option = document.createElement('option');
option.value = font.fontFamily;
option.textContent = `${font.name ?? font.fontFamily} ${font.platform ? `(${font.platform})` : ''}`;
fontSelector.appendChild(option);
};
fontSelector.addEventListener('change', function () {
const selectedFont = fontSelector.value;
document.body.style.fontFamily = selectedFont;
});
const HELLO_WORLD_IN_JAPANESE = 'ハローワールド';
function makeTesterRow(font, variant) {
const row = document.createElement('tr');
const fontCell = document.createElement('td');
const platformCell = document.createElement('td');
const testCell = document.createElement('td');
fontCell.innerHTML = !variant ? makeAnchorLinkAndFontLink(font) : makeFontLink(font);
platformCell.textContent = font.platform ?? 'Unknown';
for (const note of font.notes ?? []) {
fontCell.innerHTML += ` <a id="ref[${note}]" href="#[${note}]"><sup>[${note}]</sup></a>`;
}
testCell.style.fontFamily = `${font.fontFamily}, 'Hello Kitty', Webdings`;
testCell.textContent = 'Sphinx of black quartz, judge my vow.' + (variant ? '\n' + HELLO_WORLD_IN_JAPANESE : '');
testCell.className = 'preview' + (variant ? ' ' + variant : '');
testCell.fontVariantEastAsian = variant;
row.appendChild(fontCell);
row.appendChild(platformCell);
row.appendChild(testCell);
if (font.control) {
row.classList.add('control');
}
return row;
}
function makeSupportRow(font) {
const row = document.createElement('tr');
const fontCell = document.createElement('td');
const platformCell = document.createElement('td');
const fullwidthCell = document.createElement('td');
const halfwidthCell = document.createElement('td');
fontCell.innerHTML = makeFontLink(font);
platformCell.textContent = font.platform ?? 'Unknown';
fullwidthCell.textContent = font.supportsFullWidth ? '✔️' : '❌';
halfwidthCell.textContent = font.supportsHalfWidth ? '✔️' : '❌';
fullwidthCell.style.backgroundColor = font.supportsFullWidth ? 'lightgreen' : 'lightcoral';
halfwidthCell.style.backgroundColor = font.supportsHalfWidth ? 'lightgreen' : 'lightcoral';
for (const note of font.notes ?? []) {
fontCell.innerHTML += ` <a id="ref[${note}]" href="#[${note}]"><sup>[${note}]</sup></a>`;
}
row.appendChild(fontCell);
row.appendChild(platformCell);
row.appendChild(fullwidthCell);
row.appendChild(halfwidthCell);
return row;
}
function makeAnchorLinkAndFontLink(font) {
const href = font.name ?? font.fontFamily;
return `<a id="${href}" href="#${href}">#</a> ` + makeFontLink(font);
}
function makeFontLink(font) {
const display = font.name ?? font.fontFamily;
return font.link ? `<a href="${font.link}">${display}</a>` : (display);
}
const fontTableBody = document.getElementById('font-table-body');
const fontTableBodyFullwidth = document.getElementById('font-table-body-fullwidth');
const fontTableBodyHalfwidth = document.getElementById('font-table-body-halfwidth');
const fontTableBodySupport = document.getElementById('font-table-body-support');
for (const font of fonts) {
fontTableBody.append(makeTesterRow(font));
if (font.supportsFullWidth) {
fontTableBodyFullwidth.append(makeTesterRow(font, 'full-width'));
}
if (font.supportsHalfWidth) {
fontTableBodyHalfwidth.append(makeTesterRow(font, 'half-width'));
}
if (!font.control && font.platform !== 'multiplatform') {
fontTableBodySupport.append(makeSupportRow(font));
}
}
const tester = document.getElementById('tester');
tester.addEventListener('input', onInput);
tester.addEventListener('blur', onBlur);
const urlParams = new URLSearchParams(window.location.search);
const textParam = urlParams.get('text');
if (textParam) {
tester.value = textParam;
onInput();
}
function onInput() {
const elements = document.querySelectorAll('.preview');
elements.forEach(element => {
element.textContent = tester.value;
});
}
function onBlur() {
const url = new URL(window.location);
url.searchParams.set('text', tester.value);
window.history.replaceState({}, '', url);
}
function stripHelloWorld() {
const previews = document.querySelectorAll('.preview');
const buttons = document.querySelectorAll('.strip');
previews.forEach(element => {
element.textContent = element.textContent.replace(HELLO_WORLD_IN_JAPANESE, '').trim();
});
buttons.forEach(button => {
button.disabled = true;
});
}
</script>
</body>
</html>