-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmjfonttest.html
More file actions
174 lines (168 loc) · 7.8 KB
/
Copy pathmjfonttest.html
File metadata and controls
174 lines (168 loc) · 7.8 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Font Display Test</title>
<link
rel="stylesheet"
as="style"
crossorigin
href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css"
/>
<style>
@font-face {
font-family: "Last Resort";
src:
local("Last Resort"),
url("LastResortHE-Regular.ttf") format("ttf"),
url("LastResort-Regular.ttf") format("ttf");
}
body {
font-family: Pretendard, sans-serif;
margin: 20px;
display: flex;
flex-direction: column;
align-items: center;
}
input {
width: 100%;
font-size: 32px;
}
.uniInput {
width: 15%;
}
.input-container {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.font-display {
width: 100%;
max-width: 100%;
margin-bottom: 20px;
border: 1px solid #ccc;
font-size: 32px;
padding: 10px;
}
button {
padding: 10px 15px;
font-size: 16px;
margin-left: 5px; /* Space between input and button */
}
</style>
</head>
<body>
<div class="input-container">
<input type="text" id="textInput" placeholder="Type something..." style="font-family:'IPAmjMincho','LXGW ZhiSong MN', 'YshiMincho CL', 'I.Ming', 'LXGW Neo ZhiSong Plus'"/>
<div class="uniInput">
<input type="text" id="unicodeInput" placeholder="4e00" style="font-family:monospace;" />
</div>
<button id="addCharButton" style="font-family:Inter;">Add Character</button>
</div>
<div class="font-display" style="font-family: 'IPAmjMincho','Last Resort';">
[J] IPAmjMincho | <span id="fontMj"></span>
</div>
<div class="font-display" style="font-family: 'LXGW ZhiSong MN','Last Resort';">
[I] LXGW ZhiSong MN | <span id="fontLX"></span>
</div>
<div class="font-display" style="font-family: 'YshiMincho CL','Last Resort';">
[I] YshiMincho CL | <span id="fontYs"></span>
</div>
<div class="font-display" style="font-family: 'I.Ming','Last Resort';">
[I] I.Ming | <span id="fontIm"></span>
</div>
<div class="font-display" style="font-family: 'LXGW Neo ZhiSong Plus','Last Resort';">
[G] LXGW Neo ZhiSong | <span id="fontLN"></span>
</div>
<div class="font-display" style="font-family: 'Mizuki-Ming','Last Resort';">
[I] Mizuki Ming | <span id="fontMi"></span>
</div>
<div class="font-display" style="font-family: '致一宋體','Last Resort';">
[I] Zhiyi Serif | <span id="fontZy"></span>
</div>
<div class="font-display" style="font-family: 'HuayingMincho Classic','Last Resort';">
[I] Huaying Mincho Classic | <span id="fontHC"></span>
</div>
<div class="font-display" style="font-family: 'HuayingMincho ODict','Last Resort';">
[I] Huaying Mincho ODict | <span id="fontHD"></span>
</div>
<div class="font-display" style="font-family: 'HuayingMincho Old','Last Resort';">
[I] Huaying Mincho Old | <span id="fontHO"></span>
</div>
<div class="font-display" style="font-family: 'HuayingMincho T','Last Resort';">
[I] Huaying Mincho T | <span id="fontHT"></span>
</div>
<div class="font-display" style="font-family: 'Study Ming JP','Last Resort';">
[J] Study Ming JP | <span id="fontSj"></span>
</div>
<div class="font-display" style="font-family: 'Study Ming JA','Last Resort';">
[A] Study Ming JA | <span id="fontSa"></span>
</div>
<div class="font-display" style="font-family: 'Study Ming HK','Last Resort';">
[H] Study Ming HK | <span id="fontSh"></span>
</div>
<div class="font-display" style="font-family: 'Study Ming TW','Last Resort';">
[T] Study Ming TW | <span id="fontSt"></span>
</div>
<div class="font-display" style="font-family: 'Study Ming CN','Last Resort';">
[G] Study Ming CN | <span id="fontSg"></span>
</div>
<hr>
<p>This page is in the public domain. Pretendard and Last Resort are licensed under the OFL. All other fonts are licensed under the IPA font license. See <a href="https://github.com/FishlandicFishy/cjk-utils">the GitHub repository</a>.</p>
<p><a href="https://github.com/orioncactus/pretendard">Pretendard (body font)</a> | <a href="https://github.com/unicode-org/last-resort-font">Last Resort (fallback font)</a> | <a href="https://moji.or.jp/mojikiban/font/">IPAmjMincho</a> | <a href="https://github.com/lxgw/LxgwZhiSong">LXGW ZhiSong</a> | <a href="https://github.com/lxgw/LxgwNeoZhiSong">LXGW Neo ZhiSong</a> | <a href="https://github.com/Steve-Yuu/YShiMincho">YShiMincho</a> | <a href="https://github.com/ichitenfont/I.Ming">I.Ming</a> | <a href="https://github.com/MEE-Developers/Mizuki-Ming">Mizuki Ming</a> | <a href="https://github.com/RiyipuSipino/ZhiyiSerif">Zhiyi Serif | <a href="https://github.com/GuiWonder/HuayingMincho">Huaying Mincho</a> | <a href="https://github.com/project-ccs/font">Study Ming</a></p>
<script>
const textInput = document.getElementById('textInput');
const unicodeInput = document.getElementById('unicodeInput');
const addCharButton = document.getElementById('addCharButton');
const fontMj = document.getElementById('fontMj');
const fontLX = document.getElementById('fontLX');
const fontYs = document.getElementById('fontYs');
const fontIm = document.getElementById('fontIm');
const fontLN = document.getElementById('fontLN');
const fontMi = document.getElementById('fontMi');
const fontZy = document.getElementById('fontZy');
const fontHC = document.getElementById('fontHC');
const fontHD = document.getElementById('fontHD');
const fontHO = document.getElementById('fontHO');
const fontHT = document.getElementById('fontHT');
const fontSj = document.getElementById('fontSj');
const fontSa = document.getElementById('fontSa');
const fontSh = document.getElementById('fontSh');
const fontSt = document.getElementById('fontSt');
const fontSg = document.getElementById('fontSg');
textInput.addEventListener('input', updateFonts);
addCharButton.addEventListener('click', appendUnicodeChar);
function updateFonts() {
const inputText = textInput.value;
fontMj.textContent = inputText;
fontLX.textContent = inputText;
fontYs.textContent = inputText;
fontIm.textContent = inputText;
fontLN.textContent = inputText;
fontMi.textContent = inputText;
fontZy.textContent = inputText;
fontHC.textContent = inputText;
fontHD.textContent = inputText;
fontHO.textContent = inputText;
fontHT.textContent = inputText;
fontSj.textContent = inputText;
fontSa.textContent = inputText;
fontSh.textContent = inputText;
fontSt.textContent = inputText;
fontSg.textContent = inputText;
}
function appendUnicodeChar() {
const hexCode = unicodeInput.value.trim();
if (hexCode.match(/^[0-9A-Fa-f]{1,6}$/)) {
const char = String.fromCodePoint(parseInt(hexCode, 16));
textInput.value += char;
updateFonts();
unicodeInput.value = ''; // Clear the input after adding
} else {
alert('Please enter a valid hexadecimal codepoint (e.g. 4e00).');
}
}
</script>
</body>
</html>