75bbf00a8f
Moves font related types to `next/font` so they can be reused in font loaders. Adds an argument to font loaders, the relative path from the app root to the module consuming the loader. Needed for resolving local files relative to the module calling it. Also used to improve error message. Adds `@next/font/local` font loader. Similar to `@next/font/google` but used to host locally downloaded font files.
21 lines
548 B
JavaScript
21 lines
548 B
JavaScript
import localFont from '@next/font/local'
|
|
import {
|
|
Open_Sans,
|
|
Source_Code_Pro,
|
|
Abel,
|
|
Inter,
|
|
Roboto,
|
|
} from '@next/font/google'
|
|
|
|
const openSans = Open_Sans()
|
|
const sourceCodePro = Source_Code_Pro({ display: 'swap', preload: false })
|
|
const abel = Abel({ variant: '400', display: 'optional', preload: false })
|
|
|
|
const inter = Inter({ display: 'block', preload: true })
|
|
const roboto = Roboto({ variant: '400' })
|
|
|
|
const myLocalFont = localFont({
|
|
src: './my-font.woff2',
|
|
})
|
|
|
|
export { openSans, sourceCodePro, abel, inter, roboto, myLocalFont }
|