Skip to content

Commit

Permalink
Merge pull request #121 from 2wheeh/font
Browse files Browse the repository at this point in the history
[#120] Set default font
  • Loading branch information
2wheeh authored Jan 24, 2024
2 parents 72090ab + c7334b1 commit fa47ebd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/packages/mr-c.app/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Metadata } from 'next';
import '@/styles/globals.css';
import { notoSansKr } from '@/fonts';

export const metadata: Metadata = {
title: 'Home',
Expand All @@ -15,7 +16,7 @@ export default function RootLayout({
}) {
return (
<html lang="en">
<body>{children}</body>
<body className={`${notoSansKr.className} antialiased`}>{children}</body>
</html>
);
}
16 changes: 16 additions & 0 deletions ui/packages/mr-c.app/src/fonts/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Noto_Sans_KR as NotoSansKr } from 'next/font/google';

// next/font fetches the font files on build time
// i.e. '.next/static/media/**.woff2'
// but supports preloading only for the subsets.
// Not preloaded font files are loaded on browser later
// than html.
export const notoSansKr = NotoSansKr({
// 'korean' subset is not supported
subsets: ['latin'],
// While loading, we don't show the text with
// fallback font til 3s at most (FOIT)
// instead of showing ugly font changing (FOUT).
display: 'block',
adjustFontFallback: true,
});

0 comments on commit fa47ebd

Please sign in to comment.