Skip to content

Commit 1e5d134

Browse files
committed
fix: load Inter font for ko locale
1 parent b4cd15f commit 1e5d134

File tree

2 files changed

+35
-32
lines changed

2 files changed

+35
-32
lines changed

apps/extension/src/styles/global.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const GlobalStyle = createGlobalStyle`
1919
-webkit-font-smoothing: antialiased;
2020
2121
&[data-lang="ko"] {
22-
font-family: 'NotoSansKR', sans-serif;
22+
font-family: 'Inter', 'NotoSansKR', sans-serif;
2323
2424
word-break: keep-all;
2525
word-wrap: break-word;
@@ -49,7 +49,7 @@ export const GlobalStyle = createGlobalStyle`
4949
color: ${ColorPalette["gray-200"]};
5050
5151
&[data-lang="ko"] {
52-
font-family: 'NotoSansKR', sans-serif;
52+
font-family: 'Inter', 'NotoSansKR', sans-serif;
5353
}
5454
}
5555

apps/extension/src/use-load-fonts.ts

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,43 @@ import { useLayoutEffect, useRef, useState } from "react";
22
import { useLanguage } from "./languages";
33
import { useLayoutEffectOnce } from "./hooks/use-effect-once";
44

5+
const interFontFaces = [
6+
new FontFace(
7+
"Inter",
8+
`url(${require("./public/assets/font/Inter-Regular.ttf")})`,
9+
{
10+
weight: "400",
11+
}
12+
),
13+
new FontFace(
14+
"Inter",
15+
`url(${require("./public/assets/font/Inter-Medium.ttf")})`,
16+
{
17+
weight: "500",
18+
}
19+
),
20+
new FontFace(
21+
"Inter",
22+
`url(${require("./public/assets/font/Inter-SemiBold.ttf")})`,
23+
{
24+
weight: "600",
25+
}
26+
),
27+
new FontFace(
28+
"Inter",
29+
`url(${require("./public/assets/font/Inter-Bold.ttf")})`,
30+
{
31+
weight: "700",
32+
}
33+
),
34+
];
35+
536
const languageToFontFaces: {
637
[lang: string]: FontFace[] | undefined;
738
} = {
8-
en: [
9-
new FontFace(
10-
"Inter",
11-
`url(${require("./public/assets/font/Inter-Regular.ttf")})`,
12-
{
13-
weight: "400",
14-
}
15-
),
16-
new FontFace(
17-
"Inter",
18-
`url(${require("./public/assets/font/Inter-Medium.ttf")})`,
19-
{
20-
weight: "500",
21-
}
22-
),
23-
new FontFace(
24-
"Inter",
25-
`url(${require("./public/assets/font/Inter-SemiBold.ttf")})`,
26-
{
27-
weight: "600",
28-
}
29-
),
30-
new FontFace(
31-
"Inter",
32-
`url(${require("./public/assets/font/Inter-Bold.ttf")})`,
33-
{
34-
weight: "700",
35-
}
36-
),
37-
],
39+
en: interFontFaces,
3840
ko: [
41+
...interFontFaces,
3942
new FontFace(
4043
"NotoSansKR",
4144
`url(${require("./public/assets/font/NotoSansKR-Regular.woff2")})`,

0 commit comments

Comments
 (0)