Skip to content

Commit

Permalink
Merge pull request #11 from YAPP-Github/feat/YS-137
Browse files Browse the repository at this point in the history
[YS-137] next/local/font 폰트 적용
  • Loading branch information
eeeyooon authored Jan 12, 2025
2 parents ce6e585 + 712fbea commit 7b89e3a
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 4 deletions.
Binary file added public/fonts/Pretendard-Bold.subset.woff2
Binary file not shown.
Binary file added public/fonts/Pretendard-Medium.subset.woff2
Binary file not shown.
Binary file added public/fonts/Pretendard-Regular.subset.woff2
Binary file not shown.
Binary file added public/fonts/Pretendard-SemiBold.subset.woff2
Binary file not shown.
8 changes: 5 additions & 3 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import type { Metadata } from 'next';
import Providers from './providers';

import Footer from '@/components/Footer/Footer';
import pretendard from '@/fonts/local-font';

export const metadata: Metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
title: '그라밋',
description:
'작은 연결로 시작되는 큰 발견 | 대학원생 연구자가 대학생 참여자를 모집하여 실험을 진행할 수 있도록 돕는 플랫폼',
};

export default function RootLayout({
Expand All @@ -15,7 +17,7 @@ export default function RootLayout({
children: React.ReactNode;
}>) {
return (
<html lang="en">
<html lang="ko" className={pretendard.className}>
<body suppressHydrationWarning={true}>
<Providers>
{children}
Expand Down
38 changes: 38 additions & 0 deletions src/fonts/local-font.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import localFont from 'next/font/local';

/*
Copyright (c) 2021 Kil Hyung-jin, with Reserved Font Name Pretendard.
https://github.com/orioncactus/pretendard
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
*/

const pretendard = localFont({
src: [
{
path: '../../public/fonts/Pretendard-Bold.subset.woff2',
weight: '700',
style: 'normal',
},
{
path: '../../public/fonts/Pretendard-SemiBold.subset.woff2',
weight: '600',
style: 'normal',
},
{
path: '../../public/fonts/Pretendard-Medium.subset.woff2',
weight: '500',
style: 'normal',
},
{
path: '../../public/fonts/Pretendard-Regular.subset.woff2',
weight: '400',
style: 'normal',
},
],
variable: '--font-pretendard',
});

export default pretendard;
2 changes: 1 addition & 1 deletion src/styles/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const global = css`
${reset}
:root {
--font-family: 'Inter', sans-serif;
--font-family: 'Pretendard', 'Inter', sans-serif;
}
* {
Expand Down

0 comments on commit 7b89e3a

Please sign in to comment.