Rajdeep Singh
Jan 17, 2023

--

Yes, you can do that with the following example I find on nextjs docs.

// pages/_app.js

import localFont from '@next/font/local'

// Font files can be colocated inside of `pages`

const myFont = localFont({ src: './my-font.woff2' })

export default function MyApp({ Component, pageProps }) {

return (

<main className={myFont.className}>

<Component {...pageProps} />

</main>

)

}

learn more >>> https://nextjs.org/docs/basic-features/font-optimization#local-fonts

--

--

Rajdeep Singh
Rajdeep Singh

Written by Rajdeep Singh

Follow me if you learn more about JavaScript | TypeScript | React.js | Next.js | Linux | NixOS | Frontend Developer | https://linktr.ee/officialrajdeepsingh

Responses (1)