This repository has been archived by the owner on Jun 17, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0001-ibm-plex-sans.patch
273 lines (252 loc) · 9.74 KB
/
0001-ibm-plex-sans.patch
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
From 31772e0face62bf4830ac4ba4d6cee6568a2081f Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Sat, 15 Jun 2024 10:38:29 +0800
Subject: [PATCH] feat: use IBM Plex Sans
---
packages/backend/src/server/web/index.ts | 34 +++++++--------
packages/backend/src/server/web/style.css | 12 +-----
.../backend/src/server/web/views/base.pug | 3 ++
packages/client/src/style.scss | 43 +------------------
4 files changed, 23 insertions(+), 69 deletions(-)
diff --git a/packages/backend/src/server/web/index.ts b/packages/backend/src/server/web/index.ts
index af6e237be..2763b1dcd 100644
--- a/packages/backend/src/server/web/index.ts
+++ b/packages/backend/src/server/web/index.ts
@@ -91,8 +91,8 @@ app.use(serverAdapter.registerPlugin());
const clientEntry = JSON.parse(
readFileSync(
`${_dirname}/../../../../../built/_client_dist_/manifest.json`,
- "utf-8",
- ),
+ "utf-8"
+ )
)["src/init.ts"];
// Init renderer
@@ -104,7 +104,7 @@ app.use(
clientEntry,
config,
},
- }),
+ })
);
// Serve favicon
@@ -140,7 +140,7 @@ router.get<{ Params: { path: string } }>("/emoji/:path(.*)", async (ctx) => {
ctx.set(
"Content-Security-Policy",
- "default-src 'none'; style-src 'unsafe-inline'",
+ "default-src 'none'; style-src 'unsafe-inline'"
);
if (emoji == null) {
@@ -149,7 +149,7 @@ router.get<{ Params: { path: string } }>("/emoji/:path(.*)", async (ctx) => {
}
const url = new URL(
- `${config.mediaProxy || `${config.url}/proxy`}/emoji.webp`,
+ `${config.mediaProxy || `${config.url}/proxy`}/emoji.webp`
);
// || emoji.originalUrl してるのは後方互換性のため
url.searchParams.append("url", emoji.publicUrl || emoji.originalUrl);
@@ -224,7 +224,7 @@ router.get("/twemoji/(.*)", async (ctx) => {
ctx.set(
"Content-Security-Policy",
- "default-src 'none'; style-src 'unsafe-inline'",
+ "default-src 'none'; style-src 'unsafe-inline'"
);
await send(ctx as any, path, {
@@ -332,7 +332,7 @@ const getFeed = async (
historyCount: string,
noteInTitle: string,
noRenotes: string,
- noReplies: string,
+ noReplies: string
) => {
const meta = await fetchMeta();
if (meta.privateMode) {
@@ -365,7 +365,7 @@ const getFeed = async (
history,
noteInTitle !== undefined,
noRenotes === undefined,
- noReplies === undefined,
+ noReplies === undefined
))
);
};
@@ -414,7 +414,7 @@ const atomFeed: Router.Middleware = async (ctx) => {
ctx.query.history,
ctx.query.noteintitle,
ctx.query.norenotes,
- ctx.query.noreplies,
+ ctx.query.noreplies
);
if (feed) {
@@ -433,7 +433,7 @@ const rssFeed: Router.Middleware = async (ctx) => {
ctx.query.history,
ctx.query.noteintitle,
ctx.query.norenotes,
- ctx.query.noreplies,
+ ctx.query.noreplies
);
if (feed) {
@@ -452,7 +452,7 @@ const jsonFeed: Router.Middleware = async (ctx) => {
ctx.query.history,
ctx.query.noteintitle,
ctx.query.norenotes,
- ctx.query.noreplies,
+ ctx.query.noreplies
);
if (feed) {
@@ -537,7 +537,7 @@ router.get("/notes/:note", async (ctx, next) => {
note: packedNote,
profile,
avatarUrl: await Users.getAvatarUrl(
- await Users.findOneByOrFail({ id: note.userId }),
+ await Users.findOneByOrFail({ id: note.userId })
),
// TODO: Let locale changeable by instance setting
summary: getNoteSummary(note.fileIds, note.text, note.cw, note.hasPoll),
@@ -546,7 +546,7 @@ router.get("/notes/:note", async (ctx, next) => {
ctx.set("Cache-Control", "public, max-age=15");
ctx.set(
"Content-Security-Policy",
- "default-src 'self' 'unsafe-inline' 'unsafe-eval'; connect-src *; font-src 'self' data:; img-src * data:; media-src *; worker-src 'self'; frame-ancestors *",
+ "default-src 'self' 'unsafe-inline' 'unsafe-eval'; connect-src 'self'; style-src 'self' 'unsafe-inline' fonts.bunny.net; font-src 'self' fonts.bunny.net data:; img-src *; media-src *; worker-src 'self'; frame-ancestors *",
);
return;
@@ -571,7 +571,7 @@ router.get("/posts/:note", async (ctx, next) => {
note: packedNote,
profile,
avatarUrl: await Users.getAvatarUrl(
- await Users.findOneByOrFail({ id: note.userId }),
+ await Users.findOneByOrFail({ id: note.userId })
),
// TODO: Let locale changeable by instance setting
summary: getNoteSummary(note.fileIds, note.text, note.cw, note.hasPoll),
@@ -609,7 +609,7 @@ router.get("/@:user/pages/:page", async (ctx, next) => {
page: _page,
profile,
avatarUrl: await Users.getAvatarUrl(
- await Users.findOneByOrFail({ id: page.userId }),
+ await Users.findOneByOrFail({ id: page.userId })
),
});
@@ -641,7 +641,7 @@ router.get("/clips/:clip", async (ctx, next) => {
clip: _clip,
profile,
avatarUrl: await Users.getAvatarUrl(
- await Users.findOneByOrFail({ id: clip.userId }),
+ await Users.findOneByOrFail({ id: clip.userId })
),
});
@@ -666,7 +666,7 @@ router.get("/gallery/:post", async (ctx, next) => {
post: _post,
profile,
avatarUrl: await Users.getAvatarUrl(
- await Users.findOneByOrFail({ id: post.userId }),
+ await Users.findOneByOrFail({ id: post.userId })
),
});
diff --git a/packages/backend/src/server/web/style.css b/packages/backend/src/server/web/style.css
index 2a9325399..c524ab0b3 100644
--- a/packages/backend/src/server/web/style.css
+++ b/packages/backend/src/server/web/style.css
@@ -1,13 +1,3 @@
-/* atkinson-hyperlegible-regular - latin_latin-ext */
-@font-face {
- font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
- font-family: "Atkinson Hyperlegible";
- font-style: normal;
- font-weight: 400;
- src: url("/static-assets/fonts/atkinson-hyperlegible-v11-latin_latin-ext-regular.woff2")
- format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
-}
-
html {
background-color: var(--bg);
color: var(--fg);
@@ -133,5 +123,5 @@ html {
height: 0;
text-align: center;
padding-top: 100px;
- font-family: "Atkinson Hyperlegible", sans-serif;
+ font-family: system-ui, sans-serif;
}
diff --git a/packages/backend/src/server/web/views/base.pug b/packages/backend/src/server/web/views/base.pug
index 100e92137..7bc3d4f68 100644
--- a/packages/backend/src/server/web/views/base.pug
+++ b/packages/backend/src/server/web/views/base.pug
@@ -30,6 +30,9 @@ html
link(rel='stylesheet' href=`/static-assets/instance.css?${ timestamp }`)
link(rel='modulepreload' href=`/assets/${clientEntry.file}`)
+ link(rel='preconnect' href='https://fonts.bunny.net')
+ link(rel='stylesheet' href='https://fonts.bunny.net/css?display=swap&family=ibm-plex-sans:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i')
+
if Array.isArray(clientEntry.css)
each href in clientEntry.css
link(rel='stylesheet' href=`/assets/${href}`)
diff --git a/packages/client/src/style.scss b/packages/client/src/style.scss
index b671cecf7..0da18a6fe 100644
--- a/packages/client/src/style.scss
+++ b/packages/client/src/style.scss
@@ -25,43 +25,6 @@
//--ad: rgb(255 169 0 / 10%);
}
-/* atkinson-hyperlegible-regular - latin_latin-ext */
-@font-face {
- font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
- font-family: "Atkinson Hyperlegible";
- font-style: normal;
- font-weight: 400;
- src: url("/static-assets/fonts/atkinson-hyperlegible-v11-latin_latin-ext-regular.woff2")
- format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
-}
-/* atkinson-hyperlegible-italic - latin_latin-ext */
-@font-face {
- font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
- font-family: "Atkinson Hyperlegible";
- font-style: italic;
- font-weight: 400;
- src: url("/static-assets/fonts/atkinson-hyperlegible-v11-latin_latin-ext-italic.woff2")
- format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
-}
-/* atkinson-hyperlegible-700 - latin_latin-ext */
-@font-face {
- font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
- font-family: "Atkinson Hyperlegible";
- font-style: normal;
- font-weight: 700;
- src: url("/static-assets/fonts/atkinson-hyperlegible-v11-latin_latin-ext-700.woff2")
- format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
-}
-/* atkinson-hyperlegible-700italic - latin_latin-ext */
-@font-face {
- font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
- font-family: "Atkinson Hyperlegible";
- font-style: italic;
- font-weight: 700;
- src: url("/static-assets/fonts/atkinson-hyperlegible-v11-latin_latin-ext-700italic.woff2")
- format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
-}
-
::selection {
color: #fff;
background-color: var(--accent);
@@ -76,8 +39,7 @@ html {
accent-color: var(--accent);
overflow: auto;
overflow-wrap: break-word;
- font-family: "Atkinson Hyperlegible", Roboto, HelveticaNeue, Arial,
- sans-serif;
+ font-family: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
text-size-adjust: 100%;
@@ -89,8 +51,7 @@ html {
-webkit-text-size-adjust: none;
&.useCJKFont {
- font-family: "Hiragino Maru Gothic Pro", "BIZ UDGothic",
- "Atkinson Hyperlegible", Roboto, HelveticaNeue, Arial, sans-serif;
+ font-family: "Hiragino Maru Gothic Pro", "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif;
}
&.useSystemFont {
--
2.44.1