-
Notifications
You must be signed in to change notification settings - Fork 353
Expand file tree
/
Copy pathfonts.tsx
More file actions
65 lines (59 loc) · 1.45 KB
/
fonts.tsx
File metadata and controls
65 lines (59 loc) · 1.45 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
import localFont from "next/font/local";
import { Inter, Roboto_Mono } from "next/font/google";
export const PrimaryFont = Inter({
style: ["normal"],
weight: ["400", "500", "600"],
subsets: ["latin", "latin-ext"],
variable: "--font-primary",
});
export const SecondaryFont = localFont({
src: [
{
path: "./fonts/Aeonik-Regular.woff2",
weight: "400",
style: "normal",
},
{
path: "./fonts/Aeonik-Medium.woff2",
weight: "500",
style: "normal",
},
{
path: "./fonts/Aeonik-Bold.woff2",
weight: "600",
style: "normal",
},
],
variable: "--font-secondary",
});
export const MonoFont = Roboto_Mono({
style: ["normal"],
weight: ["400", "500", "600"],
subsets: ["latin", "latin-ext"],
variable: "--font-mono",
});
export const JapaneseFont = localFont({
src: [
{
path: "./fonts/NotoSansJP-Regular.otf",
weight: "400",
style: "normal",
},
{
path: "./fonts/NotoSansJP-Medium.otf",
weight: "500",
style: "normal",
},
{
path: "./fonts/NotoSansJP-Bold.otf",
weight: "600",
style: "normal",
},
],
variable: "--font-japanese",
preload: true
});
export const getLocalizedSecondaryFont = (language: string) =>
language === "ja" ? JapaneseFont.className : SecondaryFont.className;
export const getLocalizedPrimaryFont = (language: string) =>
language === "ja" ? JapaneseFont.className : PrimaryFont.className;